Permalink
Browse files

Handle non-existent path

  • Loading branch information...
1 parent 04b31e4 commit dda97ae3dd74ad97efef156c76bee7ce93272bda @nikhilm committed Dec 14, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 server.js
View
@@ -136,7 +136,7 @@ function viewInBrowser(request, response, id) {
var r = redis.createClient();
r.on('connected', function() {
r.get('mugshot:image:' + id, function(err, path) {
- if( err ) {
+ if( err || !path ) {
response.writeHead(404, { "content-type": "text/html" });
response.end("No such image.");
}

0 comments on commit dda97ae

Please sign in to comment.