]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ui/src/org/simantics/district/network/ui/techtype/table/ValidateTechTypeTableHandler.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 / ValidateTechTypeTableHandler.java
index 8438fd7b3898cb0000cda112fa13a299549ea5c5..67998d9af63fb5fcc7364eae763b3b4352cbdfba 100644 (file)
@@ -17,7 +17,9 @@ import org.simantics.utils.ui.ExceptionUtils;
 public class ValidateTechTypeTableHandler {
        @CanExecute
        public boolean canExecute() {
-               return TechTypeTableView.table.getCurrentTable() != null;
+               return TechTypeTableView.table != null &&
+                               TechTypeTableView.table.getCurrentTable() != null &&
+                               TechTypeTableView.table.getComponentType() != null;
        }
        
        @Execute