fix: don't forward undefined
This commit is contained in:
parent
75f2e80507
commit
f86c2ce89c
|
@ -34,12 +34,14 @@ export class Dispatcher {
|
||||||
if (debugAction) {
|
if (debugAction) {
|
||||||
debug(`dispatching ${JSON.stringify(debugAction, null, ' ')}`);
|
debug(`dispatching ${JSON.stringify(debugAction, null, ' ')}`);
|
||||||
}
|
}
|
||||||
|
const actionPromise = actions[action.type](action);
|
||||||
Promise.resolve(actions[action.type](action)).then((result) => {
|
Promise.resolve(actionPromise).then((result) => {
|
||||||
if ('undefined' === typeof result) {
|
if ('undefined' === typeof result) {
|
||||||
debug(`undefined result from ${action.type} not forwarded!`);
|
debug(`undefined result from ${action.type} not forwarded!`);
|
||||||
}
|
}
|
||||||
socket.write(pack(result));
|
else {
|
||||||
|
socket.write(pack(result));
|
||||||
|
}
|
||||||
socket.end();
|
socket.end();
|
||||||
}).catch((error) => { this.handleError(error); });
|
}).catch((error) => { this.handleError(error); });
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user