Test for boolean result before unsubscribe

This commit is contained in:
Jaco Greeff 2016-12-09 18:14:05 +01:00
parent 8f9fdb350c
commit 1b0945940b
2 changed files with 2 additions and 2 deletions

View File

@ -325,7 +325,7 @@ export default class Contract {
console.warn('_sendData', subscriptionId, error);
}
if (autoRemove && !result) {
if (autoRemove && !result && typeof result === 'boolean') {
this.unsubscribe(subscriptionId);
}
}

View File

@ -111,7 +111,7 @@ export default class Manager {
console.error(`Unable to update callback for subscriptionId ${subscriptionId}`, error);
}
if (autoRemove && !result) {
if (autoRemove && !result && typeof result === 'boolean') {
this.unsubscribe(subscriptionId);
}
}