From 8f571fd0292dedbadbd0934626b763ab625bcf51 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Thu, 6 May 2021 11:06:52 -0300 Subject: [PATCH] [FIX] App making calls to DDP after socket was killed by OS (#3062) Co-authored-by: Gerzon Z --- app/lib/rocketchat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index 3d8c50b7c..84f85a6f2 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -1140,7 +1140,7 @@ const RocketChat = { methodCall(...args) { return new Promise(async(resolve, reject) => { try { - const result = await this.sdk.methodCall(...args, this.code || ''); + const result = await this.sdk?.methodCall(...args, this.code || ''); return resolve(result); } catch (e) { if (e.error && (e.error === 'totp-required' || e.error === 'totp-invalid')) {