Protect the node.js against empty fen.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 24 Apr 2016 13:26:33 +0000 (15:26 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 24 Apr 2016 13:26:33 +0000 (15:26 +0200)
server/hash-lookup.js

index 0e7ee52..b9d5f00 100644 (file)
@@ -16,7 +16,7 @@ var init = function(servers) {
 exports.init = init;
 
 var handle_request = function(fen, response) {
-       if (!board.validate_fen(fen).valid) {
+       if (fen === undefined || fen === null || fen === '' || !board.validate_fen(fen).valid) {
                response.writeHead(400, {});
                response.end();
                return;