Skip to content

Commit

Permalink
Check for sails.io before checking for sails.io.httpServer
Browse files Browse the repository at this point in the history
Handles edge case where the server has started initializing, but socket.io didn't get all the way there yet
  • Loading branch information
sgress454 committed Feb 10, 2016
1 parent 3d4a197 commit 92c4b19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/app/lower.js
Expand Up @@ -79,7 +79,7 @@ module.exports = function lower(options, cb) {
// the onClose event possibly being called multiple times (because you can't tell
// socket.io to close without it trying to close the http server). If we're piggybacking
// we'll call sails.io.close in the main "shutdownHTTP" code below.
if (!_.isObject(sails.hooks) || !sails.hooks.sockets || (sails.io.httpServer && sails.hooks.http.server === sails.io.httpServer)) {
if (!_.isObject(sails.hooks) || !sails.hooks.sockets || (sails.io && sails.io.httpServer && sails.hooks.http.server === sails.io.httpServer)) {
return cb();
}

Expand Down

0 comments on commit 92c4b19

Please sign in to comment.