chiark / gitweb /
pctb upload: Print and throw an error if there are no offers
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Fri, 27 Aug 2010 22:25:14 +0000 (23:25 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Fri, 27 Aug 2010 22:25:14 +0000 (23:25 +0100)
src/com/tedpearson/ypp/market/MarketUploader.java

index d8efac5..715e847 100644 (file)
@@ -667,6 +667,10 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis
                                System.err.println("Error: Unsupported Commodity \"" + offer.get(0) + "\"");
                        }
                }
+               if (buySellCount[0]==0 && buySellCount[1]==0) {
+                   error("No (valid) offers for PCTB?!");
+                   throw new IllegalArgumentException();
+               }
                return buySellCount;
        }