From: jprocter Date: Mon, 20 Sep 2010 08:57:02 +0000 (+0000) Subject: more attempts to fix NPE from race condition X-Git-Tag: Release_2_6~20 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ecefdb4febd684adbc9f114e90f497eb0bbcd4b1;p=jalview.git more attempts to fix NPE from race condition --- diff --git a/src/jalview/ws/EnfinEnvision2OneWay.java b/src/jalview/ws/EnfinEnvision2OneWay.java index 3cb62c1..e0307d5 100644 --- a/src/jalview/ws/EnfinEnvision2OneWay.java +++ b/src/jalview/ws/EnfinEnvision2OneWay.java @@ -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() {