From 0c770526982104d392284c4b1e2612794bf09e67 Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Mon, 27 Feb 2012 14:20:33 +0100 Subject: [PATCH] Fixed #299 and #338 --- node/handler/ImportHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/handler/ImportHandler.js b/node/handler/ImportHandler.js index 3dccb8af..ed5eb05e 100644 --- a/node/handler/ImportHandler.js +++ b/node/handler/ImportHandler.js @@ -82,7 +82,7 @@ exports.doImport = function(req, res, padId) //this allows us to accept source code files like .c or .java function(callback) { - var fileEnding = srcFile.split(".")[1].toLowerCase(); + var fileEnding = (srcFile.split(".")[1] || "").toLowerCase(); var knownFileEndings = ["txt", "doc", "docx", "pdf", "odt", "html", "htm"]; //find out if this is a known file ending