Permalink
Browse files

Try to prevent null prices from getting set if the auction entry alre…

…ady has a price.
  • Loading branch information...
1 parent 4ba87f4 commit 6cbf094c0be4a73f41d134f388f10d623046a972 @cyberfox committed Jan 30, 2012
Showing with 10 additions and 5 deletions.
  1. +10 −5 src/com/jbidwatcher/auction/server/ebay/ebayAuction.java
@@ -801,13 +801,18 @@ private Currency establishCurrentBid(AuctionEntry ae) {
Currency maxBid = Currency.getCurrency(mDocument.getNextContentAfterContent(T.s("ebayServer.yourMaxBid")));
if(maxBid != null && maxBid.getCurrencyType() == Currency.NONE) maxBid = Currency.NoValue();
- setMinBid((Currency)ensureSafeValue(getMinBid(), ae!=null?ae.getMinBid() :Currency.NoValue(), Currency.NoValue()));
- setCurBid((Currency)ensureSafeValue(getCurBid(), ae!=null?ae.getCurBid() :Currency.NoValue(), Currency.NoValue()));
- setUSCur((Currency)ensureSafeValue(getUSCur(), ae!=null?ae.getUSCurBid():zeroDollars, Currency.NoValue()));
+ Currency preMin = (ae != null) ? ae.getMinBid() : Currency.NoValue();
+ if(getMinBid().isNull()) setMinBid(preMin);
- if(getNumBids() == 0 && (getMinBid() == null || getMinBid().isNull())) setMinBid(getCurBid());
+ Currency preCur = ae != null ? ae.getCurBid() : Currency.NoValue();
+ if(getCurBid().isNull()) setCurBid(preCur);
- if(getMinBid() == null || getMinBid().isNull()) {
+ Currency preUSCur = ae != null ? ae.getUSCurBid() : zeroDollars;
+ if(getUSCur().isNull()) setUSCur(preUSCur);
+
+ if(getNumBids() == 0 && getMinBid().isNull()) setMinBid(getCurBid());
+
+ if(getMinBid().isNull()) {
String original = mDocument.grep(T.s("ebayServer.originalBid"));
if(original != null) {
Pattern bidPat = Pattern.compile(T.s("ebayServer.originalBid"));

0 comments on commit 6cbf094

Please sign in to comment.