From 7ae5654b8394d87fa376285e5eea6078ceca0ac4 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 27 Sep 2021 15:24:53 +0530 Subject: [PATCH] guard against type errors in contextual chat while in no-drive mode --- www/common/outer/messenger.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/common/outer/messenger.js b/www/common/outer/messenger.js index 981d9f8de..85400adc0 100644 --- a/www/common/outer/messenger.js +++ b/www/common/outer/messenger.js @@ -617,11 +617,11 @@ define([ return void cb({error: 'NO_SUCH_CHANNEL'}); } - var proxy = ctx.store.proxy; + var proxy = ctx.store.proxy || {}; var msg = [Types.message, proxy.curvePublic, +new Date(), payload]; if (!channel.isFriendChat) { var name = proxy[Constants.displayNameKey] || - Messages.anonymous + '#' + proxy.uid.slice(0,5); + Messages.anonymous + '#' + (proxy.uid || ctx.store.noDriveUid).slice(0,5); msg.push(name); } var msgStr = JSON.stringify(msg);