From 8d3ccf333d062629f5804bfa2cda95ce2b40b09e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 23 Apr 2019 18:05:33 -0500 Subject: [PATCH] Fix race-condition bug --- packages/order-watcher/src/order_watcher/order_watcher.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index 7550f5c3ab..78c619859f 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -493,6 +493,9 @@ export class OrderWatcher { private async _emitRevalidateOrdersAsync(orderHashes: string[], transactionHash?: string): Promise { for (const orderHash of orderHashes) { const signedOrder = this._orderByOrderHash[orderHash]; + if (signedOrder === undefined) { + continue; + } // Most of these calls will never reach the network because the data is fetched from stores // and only updated when cache is invalidated const orderState = await this._orderStateUtils.getOpenOrderStateAsync(signedOrder, transactionHash);