diff --git a/ScratchLink/Sources/ScratchLink/Resources/inject-scratch-link.js b/ScratchLink/Sources/ScratchLink/Resources/inject-scratch-link.js index ca94fa2..05dcaf6 100644 --- a/ScratchLink/Sources/ScratchLink/Resources/inject-scratch-link.js +++ b/ScratchLink/Sources/ScratchLink/Resources/inject-scratch-link.js @@ -31,7 +31,9 @@ class ScratchLink { socketId: this.socketId }); - this.onclose(); + if (this.onclose) { + this.onclose(); + } ScratchLink.sockets.delete(this.socketId); }