chat: prevent crashes if join is interrupted

Fixes #3748.
This commit is contained in:
Matilde Park 2020-10-19 22:04:41 -04:00
parent 4354fdde09
commit 164e90b53f

View File

@ -25,8 +25,8 @@ export function ChatResource(props: ChatResourceProps) {
return null;
}
const { envelopes, config } = props.inbox[station];
const { read, length } = config;
const { envelopes, config } = (props.inbox?.[station]) ? props.inbox[station] : {envelopes: [], config: {}};
const { read, length } = (config) ? config : undefined;
const groupPath = props.association["group-path"];
const group = props.groups[groupPath];