diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewWorkbook.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewWorkbook.java index dfd234a071c..6150010a64c 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewWorkbook.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/CommandsViewWorkbook.java @@ -244,7 +244,7 @@ public class CommandsViewWorkbook extends Composite IRemoteCommandShell command = (IRemoteCommandShell)((CommandsViewPage)data).getInput(); try { IRemoteCmdSubSystem cmdSubSystem = command.getCommandSubSystem(); - if (cmdSubSystem != null){ + if (cmdSubSystem != null && cmdSubSystem.isConnected()){ cmdSubSystem.removeShell(command); } }