Skip to content

Commit

Permalink
Handle nonxistent games.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlas committed Nov 1, 2012
1 parent cba087e commit 5ee8a7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions game.js
Expand Up @@ -435,6 +435,12 @@ function handleGames(request, response, path) {
} else {
// return info on a specifc game
var game = games[path.shift()];
if (game === undefined) {
response.writeHead(404, {'Content-Type': 'text/json'});
response.write("No such game exists", 'utf-8');
response.end();
return;
}
handleGame(request, response, game, path);
}
}
Expand Down

0 comments on commit 5ee8a7f

Please sign in to comment.