guard against type errors in contextual chat while in no-drive mode

pull/1/head
ansuz 3 years ago
parent ca95af082d
commit 7ae5654b83

@ -617,11 +617,11 @@ define([
return void cb({error: 'NO_SUCH_CHANNEL'}); 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]; var msg = [Types.message, proxy.curvePublic, +new Date(), payload];
if (!channel.isFriendChat) { if (!channel.isFriendChat) {
var name = proxy[Constants.displayNameKey] || 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); msg.push(name);
} }
var msgStr = JSON.stringify(msg); var msgStr = JSON.stringify(msg);

Loading…
Cancel
Save