From ecefdb4febd684adbc9f114e90f497eb0bbcd4b1 Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 20 Sep 2010 08:57:02 +0000 Subject: [PATCH] more attempts to fix NPE from race condition --- src/jalview/ws/EnfinEnvision2OneWay.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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() { -- 1.7.10.2