Browse Source

Avoid NullPointer on incompatible selection

benjamin.schwertfeger@googlemail.com 12 years ago
parent
commit
d57b8e1f5e

+ 1 - 1
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/commands/SetEntryKindCommand.java

@@ -73,7 +73,7 @@ public abstract class SetEntryKindCommand extends AbstractHandler {
 	public boolean isEnabled() {
 		ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getSelection();
 		entry = unwrap(selection);
-		return !entry.getKind().equals(getEntryKind());
+		return entry != null && !entry.getKind().equals(getEntryKind());
 	}
 
 }