Fixes error when logs returns undefined

mattlockyer-patch-1
Matt Lockyer 5 years ago committed by GitHub
parent 0ff928bc62
commit 6d85dbf4ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      packages/harmony-network/src/subscriptions/LogSub.ts

@ -26,11 +26,12 @@ export class LogSub extends SubscriptionMethod {
}
const logs = getPastLogs.result;
logs.forEach((log: any) => {
const formattedLog = this.onNewSubscriptionItem(log);
this.emitter.emit('data', formattedLog);
});
if (logs !== undefined) {
logs.forEach((log: any) => {
const formattedLog = this.onNewSubscriptionItem(log);
this.emitter.emit('data', formattedLog);
});
}
delete this.options.fromBlock;
// const sub = this.start();

Loading…
Cancel
Save