fix: guard against null deref

This commit is contained in:
cha0s 2020-07-24 07:48:47 -05:00
parent e08040897f
commit a4e30c0424

View File

@ -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}));
});
},