Fixed an exception being thrown when the application exits
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Wed, 25 Sep 2019 10:06:27 +0000 (12:06 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Wed, 25 Sep 2019 10:06:27 +0000 (12:06 +0200)
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/SimulationViewEditor.java

index f83dfa7..aece3ac 100644 (file)
@@ -113,11 +113,13 @@ public class SimulationViewEditor extends EditorPart
                        if (((CoreClock) o).isOn())
                        {
                                exec.pauseLiveExecution();
-                               Display.getDefault().asyncExec(() ->
-                               {
-                                       pauseButton.setSelection(false);
-                                       setPauseText(pauseButton, false);
-                               });
+                               if (!pauseButton.isDisposed())
+                                       Display.getDefault().asyncExec(() ->
+                                       {
+                                               if (!pauseButton.isDisposed())
+                                                       pauseButton.setSelection(false);
+                                               setPauseText(pauseButton, false);
+                                       });
                        }
                };