From f78450aa8602e8c1fa5c5d5fdae0da1088124023 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 21 Mar 2021 22:12:20 -0700 Subject: [PATCH] Fixed MeshRelay excpetion issue. --- meshrelay.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshrelay.js b/meshrelay.js index ff7a26e0..474af789 100644 --- a/meshrelay.js +++ b/meshrelay.js @@ -201,7 +201,7 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) { // Push any stored message to the peer obj.sendPeerImage = function () { - if (obj.id.startsWith('meshmessenger/') && (obj.peer != null) && (obj.user != null) && (typeof obj.user.flags == 'number') && (obj.user.flags & 1)) { + if ((typeof obj.id == 'string') && obj.id.startsWith('meshmessenger/') && (obj.peer != null) && (obj.user != null) && (typeof obj.user.flags == 'number') && (obj.user.flags & 1)) { parent.db.Get('im' + obj.user._id, function (err, docs) { if ((err == null) && (docs != null) && (docs.length == 1) && (typeof docs[0].image == 'string')) { try { obj.peer.ws.send(JSON.stringify({ ctrlChannel: '102938', type: 'image', image: docs[0].image })); } catch (ex) { }