-
Notifications
You must be signed in to change notification settings - Fork 2
Fix conditional to check if there is a result returned from Server method #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- "4" | ||
- "6" | ||
- "8" | ||
after_success: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,7 +204,7 @@ export class Server extends EventEmitter { | |
} | ||
|
||
// handle synchronous results | ||
if (result && (!result.then || typeof result.then !== 'function')) { | ||
if (typeof result !== 'undefined' && (!result.then || typeof result.then !== 'function')) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I think I see... the issue is that the result from the call is actually a scalar boolean value of |
||
debug('Server: method %s returned synchronously', socket.request.method); | ||
|
||
// handle the result of the method when not a Promise... | ||
|
@@ -340,4 +340,4 @@ export class Server extends EventEmitter { | |
} | ||
} | ||
|
||
export default { Server }; | ||
export default { Server }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the original if statement will actually properly filter if the
response.result
is trulyundefined
and this statement check is more specific and feels unnecessary in this case... was this a change for testing purposes that can be backed out?