Bug 467326 - NullPointerException in IOConsolePartition.delete (85)
The possible attempt to delete from read-only partition is fixed
Change-Id: Id1a63ba5ef1cf74f3a594ba67e99f93cb59ea7cb
Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java
index b02fe4f..b18f518 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -377,7 +377,7 @@
if (amountDeleted > 0) {
int offset = event.fOffset;
IOConsolePartition partition = (IOConsolePartition) getPartition(offset);
- if(partition == lastPartition) {
+ if (partition == lastPartition && IOConsolePartition.INPUT_PARTITION_TYPE.equals(partition.getType())) {
partition.delete(event.fOffset-partition.getOffset(), amountDeleted);
}
}