Fix for Bug 155866 Problems when closing unsaved editor and deleted project
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorManager.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorManager.java index 0b6ac0f..86d59ce 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorManager.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorManager.java
@@ -1552,6 +1552,15 @@ if (persistable == null) return; + // Workaround for bug 155866. Don't try to save the editor state if the path is null. + // The workaround is safe because not checking here would generate a NPE later on. + if (input instanceof IPathEditorInput) { + IPath path = ((IPathEditorInput)input).getPath(); + if (path == null) { + return; + } + } + // Save editor. IMemento editorMem = memento.createChild(IWorkbenchConstants.TAG_EDITOR); editorMem.putString(IWorkbenchConstants.TAG_TITLE, editorRef.getTitle());