From 4b52d0e8c9a5e19378bb5140891352fdbea8034f Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Wed, 28 Oct 2020 23:20:09 +0530 Subject: [PATCH] Possible QR scan bug fix --- src/WAConnection/3.Connect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WAConnection/3.Connect.ts b/src/WAConnection/3.Connect.ts index 7b53204..289eb63 100644 --- a/src/WAConnection/3.Connect.ts +++ b/src/WAConnection/3.Connect.ts @@ -330,7 +330,7 @@ export class WAConnection extends Base { */ let anyTriggered = false const l0 = json[0] || '' - const l1 = typeof json[1] !== 'object' ? {} : json[1] + const l1 = typeof json[1] !== 'object' || json[1] === null ? {} : json[1] const l2 = ((json[2] || [])[0] || [])[0] || '' Object.keys(l1).forEach(key => { anyTriggered = anyTriggered || this.emit (`${DEF_CALLBACK_PREFIX}${l0},${key}:${l1[key]},${l2}`, json)