commit | 32e69dd62d9b735a846e5195d0a83c48fb70101a | [log] [tgz] |
---|---|---|
author | nitind <nitind> | Wed Nov 11 22:53:25 2009 +0000 |
committer | nitind <nitind> | Wed Nov 11 22:53:25 2009 +0000 |
tree | dc26b861f2ea9611b3604aa5680cbf49dd909196 | |
parent | 7aa1189d5ce157e8ba8bad7bfa59757bb5369490 [diff] |
[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;