Add try/catch and null checks

This commit is contained in:
Manfred Karrer 2016-07-23 14:53:00 +02:00
parent 76b24838f6
commit bb6436eb0a

View file

@ -33,18 +33,19 @@ public class PublishTradeStatistics extends TradeTask {
@Override
protected void run() {
runInterceptHook();
TradeStatistics tradeStatistics = new TradeStatistics(trade.getOffer(),
trade.getTradePrice(),
trade.getTradeAmount(),
trade.getDate(),
trade.getDepositTx().getHashAsString(),
trade.getContractHash(),
processModel.getPubKeyRing());
processModel.getP2PService().addData(tradeStatistics, true);
try {
runInterceptHook();
TradeStatistics tradeStatistics = new TradeStatistics(trade.getOffer(),
trade.getTradePrice(),
trade.getTradeAmount(),
trade.getDate(),
(trade.getDepositTx() != null ? trade.getDepositTx().getHashAsString() : ""),
trade.getContractHash(),
processModel.getPubKeyRing());
processModel.getP2PService().addData(tradeStatistics, true);
complete();
} catch (Throwable t) {
failed(t);
}
}
}