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 d8efac50a27d23dbcf5b84cff45ada8efabc99a3..715e847b895eac70e691b0fce699ea256b01edc0 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;
        }