From c902e8460d77988aa3e0acd027ed64b174f32e1b Mon Sep 17 00:00:00 2001 From: Yoojin Ko Date: Wed, 14 Feb 2024 17:04:12 +0900 Subject: [PATCH] fix: check address --- src/handlers/handler.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/handlers/handler.ts b/src/handlers/handler.ts index 230bdf5..8ec99d5 100644 --- a/src/handlers/handler.ts +++ b/src/handlers/handler.ts @@ -28,13 +28,18 @@ export default class Handler { async disconnect() { this.checkEventManager(); await this.ain.getEventManager().disconnect(); - console.log('disconnected'); + console.log('Disconnected'); } private async disconnectedCb() { - if(await AinModule.getInstance().getAddress()) { - console.log('disconnected. reconnecting...'); - await this.connect(); + try { + const address = await AinModule.getInstance().getAddress(); + if (address) { + console.log('Disconnected. Reconnecting...'); + await this.connect(); + } + } catch (_) { + return; } }