From 58219ab0eb3c9b2dc1115dc44f17ce6ff4ca3dbf Mon Sep 17 00:00:00 2001 From: JuLi0n21 Date: Wed, 18 Mar 2026 10:58:36 +0100 Subject: [PATCH] better type checking --- api.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api.ts b/api.ts index b5b8813..bda7881 100644 --- a/api.ts +++ b/api.ts @@ -90,9 +90,11 @@ export class WSBackend { Object.keys(this.callbacks).forEach(id => { const callbackData = this.callbacks[id]; + if (callbackData) { clearTimeout(callbackData.timeout); callbackData.callback({ message: 'WebSocket disconnected' }, null); delete this.callbacks[id]; + } }); if (wasConnected) {