chiark / gitweb /
Fix latch bug.
authorOwen S. Dunn <osd1000@tacitus.greenend.org.uk>
Tue, 22 Dec 2009 14:17:51 +0000 (14:17 +0000)
committerOwen S. Dunn <osd1000@tacitus.greenend.org.uk>
Tue, 22 Dec 2009 14:17:51 +0000 (14:17 +0000)
src/com/tedpearson/ypp/market/MarketUploader.java

index 756dec3..4886868 100644 (file)
@@ -305,7 +305,6 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
 
                Accessible leagueTracker = descendNodes(window,new int[] {0,1,0,0,2,1,1,1});
                try {
-                       latch = new java.util.concurrent.CountDownLatch(0);
                        islandName = ((JLabel)leagueTracker).getToolTipText();
                } catch (NullPointerException e) {
                        
@@ -390,7 +389,9 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
                getIsland();
                getOcean();
 
-               latch.await(2, java.util.concurrent.TimeUnit.SECONDS);
+               if (latch != null) {
+                   latch.await(2, java.util.concurrent.TimeUnit.SECONDS);
+               }
 
                ArrayList<ArrayList<String>> data = getData(t);