JAL-3328 improvement to the EQinvoke code
[jalview.git] / getdown / src / getdown / launcher / src / main / java / com / threerings / getdown / launcher / Getdown.java
index bb018dd..fdf4b15 100644 (file)
@@ -1108,18 +1108,25 @@ public abstract class Getdown extends Thread
     
     // Asynchronous or synchronous progress updates
     protected void EQinvoke(Runnable r) {
+      
       try {
         readConfig(false);
-        if (_ifc.progressSync) {
+      } catch (Exception e) {
+        log.warning("Could't read config when invoking GUI action", "Exception", e.getMessage());
+      }
+      if (! (_ifc == null) && _ifc.progressSync) {
+        try {
           EventQueue.invokeAndWait(r);
-        } else {
+        } catch (Exception e) {
+          log.warning("Tried to invokeAndWait but couldn't. Going to invokeLater instead", "Exception", e.getMessage());
           EventQueue.invokeLater(r);
         }
-      } catch (Exception e) {
+      } else {
         EventQueue.invokeLater(r);
       }
+      
     }
-
+    
     protected Application _app;
     protected Application.UpdateInterface _ifc = new Application.UpdateInterface(Config.EMPTY);