interface: prevent crash in reducers on new group DMs

Fixes urbit/landscape#1044
This commit is contained in:
Liam Fitzgerald 2021-07-19 15:40:07 +10:00
parent 22d0d9557f
commit efde98d57e
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -103,6 +103,9 @@ const addMembers = (json: GroupUpdate, state: GroupState): GroupState => {
if ('addMembers' in json) {
const { resource, ships } = json.addMembers;
const resourcePath = resourceAsPath(resource);
if(!(resourcePath in state.groups)) {
return;
}
for (const member of ships) {
state.groups[resourcePath].members.add(member);
if (