[nobug] avoid possible NPE running tests with no active editor
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleEditModeHandler.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleEditModeHandler.java index ead4fea..c36673f 100644 --- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleEditModeHandler.java +++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/handlers/ToggleEditModeHandler.java
@@ -100,7 +100,7 @@ ITextEditor textEditor = null; if (editor instanceof ITextEditor) textEditor = (ITextEditor) editor; - else { + else if (editor != null) { Object o = editor.getAdapter(ITextEditor.class); if (o != null) textEditor = (ITextEditor) o;