diff --git a/src/blockchain/log-processors/order-filled.ts b/src/blockchain/log-processors/order-filled.ts index 873a4f1d7..94d6aaeaa 100644 --- a/src/blockchain/log-processors/order-filled.ts +++ b/src/blockchain/log-processors/order-filled.ts @@ -75,6 +75,7 @@ export function calculateProfitLossInOutcome(augur: Augur, trx: Knex.Transaction if (err) return callback(err); trx.select("price").from("outcomes").where({ marketID, outcome }).asCallback((err: Error|null, outcomesRows?: Array): void => { if (err) return callback(err); + if (!outcomesRows || !outcomesRows.length) return callback(null); const { price } = outcomesRows![0]; callback(null, augur.trading.calculateProfitLoss({ trades: userTradingHistory, lastPrice: price })); });