Prevent crashing when we try to delete a non-existent offer.

This commit is contained in:
JoelKatz
2013-05-14 11:01:58 -07:00
parent 098145bd51
commit 471d4e0505

View File

@@ -985,8 +985,10 @@ TER LedgerEntrySet::offerDelete(SLE::ref sleOffer, const uint256& uOfferIndex, c
TER LedgerEntrySet::offerDelete(const uint256& uOfferIndex)
{
SLE::pointer sleOffer = entryCache(ltOFFER, uOfferIndex);
const uint160 uOwnerID = sleOffer->getFieldAccount(sfAccount).getAccountID();
if (!sleOffer)
return tesSUCCESS;
const uint160 uOwnerID = sleOffer->getFieldAccount160(sfAccount);
return offerDelete(sleOffer, uOfferIndex, uOwnerID);
}