]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ui/src/org/simantics/district/network/ui/techtype/table/ResetComponentsHandler.java
Fix NPEs in tech type command handlers' canExecute()
[simantics/district.git] / org.simantics.district.network.ui / src / org / simantics / district / network / ui / techtype / table / ResetComponentsHandler.java
index a95ecec4fd62901a673a058e5cad5633f766b650..8639fc07214bbb699485fd7e68431789ac95daaf 100644 (file)
@@ -16,7 +16,9 @@ public class ResetComponentsHandler {
 
        @CanExecute
        public boolean canExecute() {
-               return TechTypeTableView.table.getCurrentTable() != null;
+               return TechTypeTableView.table != null &&
+                       TechTypeTableView.table.getCurrentTable() != null &&
+                       TechTypeTableView.table.getComponentType() != null;
        }
        
        @Execute