Fixed MeshRelay excpetion issue.

Ylian Saint-Hilaire committed Mar 21, 2021 at 22:12 UTC f78450aa8602e8c1fa5c5d5fdae0da1088124023
1 file changed +1 -1
meshrelay.js
+1 -1
@@ -201,7 +201,7 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) {
201
202 // Push any stored message to the peer
203 obj.sendPeerImage = function () {
204 - if (obj.id.startsWith('meshmessenger/') && (obj.peer != null) && (obj.user != null) && (typeof obj.user.flags == 'number') && (obj.user.flags & 1)) {
204 + if ((typeof obj.id == 'string') && obj.id.startsWith('meshmessenger/') && (obj.peer != null) && (obj.user != null) && (typeof obj.user.flags == 'number') && (obj.user.flags & 1)) {
205 parent.db.Get('im' + obj.user._id, function (err, docs) {
206 if ((err == null) && (docs != null) && (docs.length == 1) && (typeof docs[0].image == 'string')) {
207 try { obj.peer.ws.send(JSON.stringify({ ctrlChannel: '102938', type: 'image', image: docs[0].image })); } catch (ex) { }