more attempts to fix NPE from race condition
authorjprocter <Jim Procter>
Mon, 20 Sep 2010 08:57:02 +0000 (08:57 +0000)
committerjprocter <Jim Procter>
Mon, 20 Sep 2010 08:57:02 +0000 (08:57 +0000)
src/jalview/ws/EnfinEnvision2OneWay.java

index 3cb62c1..e0307d5 100644 (file)
@@ -404,7 +404,8 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements
    */
   private JMenu buildGroupURLMenu(SequenceI[] seqs, SequenceGroup sg)
   {
-
+    if (groupURLdescr==null || groupURLLinks==null)
+      return null;
     // TODO: usability: thread off the generation of group url content so root
     // menu appears asap
     // sequence only URLs
@@ -478,8 +479,8 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements
     int[] nsqtype = new int[] { 0,0,0,0,0,0,0,0,0,0};
     for (int i = 0; i < groupURLLinks.size(); i++)
     {
-      String link = groupURLLinks.elementAt(i).toString();
-      String descr = groupURLdescr.elementAt(i).toString();
+      String link = (String) groupURLLinks.elementAt(i);
+      String descr = (String) groupURLdescr.elementAt(i);
 
       // boolean specialCase =
       // additionalPar.elementAt(i).toString().equals(BACKGROUND);
@@ -640,7 +641,7 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements
 
       public void menuSelected(MenuEvent e)
       {
-        if (refresh)
+        if (refresh && !isRunning())
         {
           new Thread(new Runnable() {
             public void run() {