chiark / gitweb /
always insist on knowing the island name
[jarrg-ian.git] / src / com / tedpearson / ypp / market / MarketUploader.java
index 98c5dd8808ecbe1b1c3c21c04811f33afd495520..2466b44a8b3fc35fa5c78de039fe022c9c47d276 100644 (file)
@@ -282,7 +282,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
                                                resultSummary.setText("");
                                                arbitrageResult.setText("");
                                                try {
-                                                       runPCTB();
+                                                       runUpload();
                                                } catch(Exception e) {
                                                        error(e.toString());
                                                        e.printStackTrace();
@@ -399,7 +399,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
        *
        *       @exception Exception if an error we didn't expect occured
        */
-       private void runPCTB() throws Exception {
+       private void runUpload() throws Exception {
                progresslog("starting");
 
                String yarrgts = "";
@@ -438,6 +438,11 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
                    latch.await(2, java.util.concurrent.TimeUnit.SECONDS);
                }
 
+               if (islandName == null) {
+                   error("Could not find island name in YPP user interface.");
+                   return;
+               }
+
                progresslog("table check...");
 
                String headings_expected[] = new String[]
@@ -497,11 +502,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
                        progressNote(pm, "Yarrg: Uploading");
                        progresslog("yarrg upload...");
 
-                       if (islandName != null) {
-                               doneyarrg = runYarrg(yarrgts, oceanName, islandName, yarrgdata);
-                       } else {
-                               System.out.println("Couldn't upload to Yarrg - no island name found");
-                       }
+                       doneyarrg = runYarrg(yarrgts, oceanName, islandName, yarrgdata);
                        progresslog("yarrg done.");
                }