From: lempinen Date: Thu, 28 Feb 2013 06:52:31 +0000 (+0000) Subject: Null check for saving equations before experiment actions. (refs #4130) X-Git-Tag: simantics-1.10.1~20 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=2fe91f0411feb9daa12840ca316da7977a2e5c47;p=simantics%2Fsysdyn.git Null check for saving equations before experiment actions. (refs #4130) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26935 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/HandlerUtils.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/HandlerUtils.java index af029760..05771fbe 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/HandlerUtils.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/HandlerUtils.java @@ -22,6 +22,12 @@ public class HandlerUtils { if (event.getTrigger() instanceof Event) { Event trigger = (Event)event.getTrigger(); Control focusControl = trigger.display.getFocusControl(); + if(focusControl == null) { + new Exception( + "Could not determine, if equation needs to be saved before action. focusControl == null") + .printStackTrace(); + return; + } Composite parent = focusControl.getParent(); /* Scan bottom-up if we come across an EquationTab.