Fixed an exception being thrown when the application exits
[Mograsim.git] / 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);
+                                       });
                        }
                };