aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-01-16 22:50:15 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-16 22:50:15 +0800
commita45de6d4273ef3f4f6b676c948fc1b6e4c673ab7 (patch)
treed048fd616008d335f48e0849d3416c9d41f8bc88 /packages
parenta350638526fbc50c0dba33b0a77bd74685fed532 (diff)
downloaddexon-sol-tools-a45de6d4273ef3f4f6b676c948fc1b6e4c673ab7.tar.gz
dexon-sol-tools-a45de6d4273ef3f4f6b676c948fc1b6e4c673ab7.tar.zst
dexon-sol-tools-a45de6d4273ef3f4f6b676c948fc1b6e4c673ab7.zip
Return is pensing events are undefined
Diffstat (limited to 'packages')
-rw-r--r--packages/0x.js/src/order_watcher/event_watcher.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/0x.js/src/order_watcher/event_watcher.ts b/packages/0x.js/src/order_watcher/event_watcher.ts
index 43a60957b..5d05bfb60 100644
--- a/packages/0x.js/src/order_watcher/event_watcher.ts
+++ b/packages/0x.js/src/order_watcher/event_watcher.ts
@@ -51,6 +51,10 @@ export class EventWatcher {
}
private async _pollForBlockchainEventsAsync(callback: EventWatcherCallback): Promise<void> {
const pendingEvents = await this._getEventsAsync();
+ if (_.isUndefined(pendingEvents)) {
+ // HACK: This should never happen, but happens frequently on CI due to a ganache bug
+ return;
+ }
if (pendingEvents.length === 0) {
// HACK: Sometimes when node rebuilds the pending block we get back the empty result.
// We don't want to emit a lot of removal events and bring them back after a couple of miliseconds,