From efde98d57e1a82015440a9c1697d506cba7866c7 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Mon, 19 Jul 2021 15:40:07 +1000 Subject: [PATCH] interface: prevent crash in reducers on new group DMs Fixes urbit/landscape#1044 --- pkg/interface/src/logic/reducers/group-update.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/interface/src/logic/reducers/group-update.ts b/pkg/interface/src/logic/reducers/group-update.ts index a008b64c6..798ec3d2d 100644 --- a/pkg/interface/src/logic/reducers/group-update.ts +++ b/pkg/interface/src/logic/reducers/group-update.ts @@ -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 (