Skip to content

Commit b0cc43c

Browse files
committed
wrap unsubscribe in check for subscribers
1 parent e9f64da commit b0cc43c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/dd-trace/src/dcitm.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ if (!dc.subscribe) {
1111
}
1212
if (!dc.unsubscribe) {
1313
dc.unsubscribe = (channel, cb) => {
14-
dc.channel(channel).unsubscribe(cb)
14+
if (dc.channel(channel).hasSubscribers) {
15+
dc.channel(channel).unsubscribe(cb)
16+
}
1517
}
1618
}
1719

0 commit comments

Comments
 (0)