From 1c9b0619e4eebbc94b0f633e8590060de1c82ba0 Mon Sep 17 00:00:00 2001 From: Victor Rubezhny Date: Thu, 14 May 2015 15:44:48 +0300 Subject: 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 --- .../src/org/eclipse/ui/internal/console/IOConsolePartitioner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 b02fe4f57..b18f518ba 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 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum 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); } } -- cgit v1.2.3