Permalink
Browse files

Fixed fileServer to not crash when Object.prototype is extended, as p…

…er pull request #133.
  • Loading branch information...
1 parent 755dea0 commit 32316d1f85090117d7395b45d55af0b0d1ccc9f6 @steveWang steveWang committed Aug 16, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/fileServer.js
View
@@ -34,13 +34,17 @@ handleResponse = function (request, response) {
} else {
// Make sure default listeners are still handled
for (i in defaultListeners) {
- defaultListeners[i].call(server, request, response);
+ if (nowUtil.hasProperty(defaultListeners, i)) {
+ defaultListeners[i].call(server, request, response);
+ }
}
}
} else {
for (i in defaultListeners) {
// Make sure default listeners are still handled
- defaultListeners[i].call(server, request, response);
+ if (nowUtil.hasProperty(defaultListeners, i)) {
+ defaultListeners[i].call(server, request, response);
+ }
}
}
};

0 comments on commit 32316d1

Please sign in to comment.