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