From 2fe91f0411feb9daa12840ca316da7977a2e5c47 Mon Sep 17 00:00:00 2001 From: lempinen Date: Thu, 28 Feb 2013 06:52:31 +0000 Subject: [PATCH] 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 --- .../src/org/simantics/sysdyn/ui/utils/HandlerUtils.java | 6 ++++++ 1 file changed, 6 insertions(+) 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. -- 2.47.1