Skip to content

Commit a245f13

Browse files
Merge pull request #694 from ilyagru/add-checks-for-listeners-remove
Add checks for listeners remove calls
2 parents 7613645 + 962c940 commit a245f13

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/BranchSubscriber.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,18 @@ export default class BranchSubscriber {
118118
this._subscribed = false
119119

120120
if (this.options.onOpenStart) {
121-
this.initSessionStart.remove()
121+
if (this.initSessionStart) {
122+
this.initSessionStart.remove()
123+
};
122124
}
123125

124126
if (this.options.onOpenComplete) {
125-
this.initSessionSuccess.remove()
126-
this.initSessionError.remove()
127+
if (this.initSessionSuccess) {
128+
this.initSessionSuccess.remove();
129+
}
130+
if (this.initSessionError) {
131+
this.initSessionError.remove()
132+
}
127133
}
128134
}
129135
}

0 commit comments

Comments
 (0)