Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2018-09-11 01:49:35 -0400
committerSarika Sinha2018-09-18 04:44:23 -0400
commitc3c5ee9f803eeffbba3226b91d7e481cef8a7712 (patch)
tree9d850b2f0d6a27fbfaa20dbaf126c6e37a4008be
parenta2f3feaa800d097b5f41348d3ff3458d07d75fdc (diff)
downloadeclipse.platform.debug-c3c5ee9f803eeffbba3226b91d7e481cef8a7712.tar.gz
eclipse.platform.debug-c3c5ee9f803eeffbba3226b91d7e481cef8a7712.tar.xz
eclipse.platform.debug-c3c5ee9f803eeffbba3226b91d7e481cef8a7712.zip
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java
index f9675bf2c..6c0d07cc6 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java
@@ -75,6 +75,11 @@ public class IOConsolePartition implements ITypedRegion {
* @param offset the offset in the partition
*/
public void insert(String s, int insertOffset) {
+ if (insertOffset < 0) {
+ insertOffset = 0;
+ } else if (insertOffset > buffer.length()) {
+ insertOffset = buffer.length();
+ }
buffer.insert(insertOffset, s);
length += s.length();
}

Back to the top