Permalink
Browse files

msg may be null

  • Loading branch information...
marcuswestin committed Jul 12, 2011
1 parent c12a62e commit 3a608c59708367aa0b144b2803709ebbb32ac986
Showing with 1 addition and 1 deletion.
  1. +1 −1 server.js
View
@@ -170,7 +170,7 @@ function _getModuleCode(reqPath) {
/* util
******/
function _sendError(res, msg) {
- msg = msg.replace(/\n/g, '\\n').replace(/"/g, '\\"')
+ if (msg) { msg = msg.replace(/\n/g, '\\n').replace(/"/g, '\\"') }
res.writeHead(200)
res.end('alert("error: ' + msg + '")')
}

0 comments on commit 3a608c5

Please sign in to comment.