Fixes failing test.

This commit is contained in:
Joshi 2020-01-13 14:05:43 -08:00
parent 5d8252bb07
commit a6825f530c

View File

@ -73,7 +73,9 @@ export default class TelemetryCriterion extends EventEmitter {
*/
unsubscribe() {
//unsubscribe from telemetry source
this.subscription();
if (typeof this.subscription === 'function') {
this.subscription();
}
delete this.subscription;
this.emit('criterion::Remove', this.telemetryObjectIdAsString);
delete this.telemetryObjectIdAsString;