From a4e30c04247ace8f9c8cc1d76eaac0161019efb9 Mon Sep 17 00:00:00 2001 From: cha0s Date: Fri, 24 Jul 2020 07:48:47 -0500 Subject: [PATCH] fix: guard against null deref --- src/client/store/effects.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/store/effects.js b/src/client/store/effects.js index 5e96f83..a2f975a 100644 --- a/src/client/store/effects.js +++ b/src/client/store/effects.js @@ -95,7 +95,11 @@ const effects = { }, [submitJoin]: ({dispatch}, {payload}) => { const {channel} = payload; - socket.send(new Join(payload), (error, {messages, users}) => { + socket.send(new Join(payload), (error, result) => { + if (error) { + return; + } + const {messages, users} = result; dispatch(join({channel, messages, users})); }); },