diff --git a/packages/nc-gui/plugins/tele.ts b/packages/nc-gui/plugins/tele.ts index 5e635629e9..0f9c82dc2e 100644 --- a/packages/nc-gui/plugins/tele.ts +++ b/packages/nc-gui/plugins/tele.ts @@ -84,8 +84,12 @@ export default defineNuxtPlugin(async (nuxtApp) => { } watch((nuxtApp.$state as ReturnType).token, (newToken, oldToken) => { - if (newToken && newToken !== oldToken) init(newToken) - else if (!newToken) socket.disconnect() + try { + if (newToken && newToken !== oldToken) init(newToken) + else if (!newToken) socket?.disconnect() + } catch (e) { + console.error(e) + } }) nuxtApp.provide('tele', tele)