From 5142a78bee3fcc56e08febdf47521ad2abe2f540 Mon Sep 17 00:00:00 2001 From: lancemanfv Date: Wed, 20 Feb 2013 23:29:06 +0200 Subject: [PATCH] Update src/app/tasks.coffee 20/02/13 Added a check for undefined value, more at https://github.com/lefnire/habitrpg/issues/463 -lancemanfv --- src/app/tasks.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/tasks.coffee b/src/app/tasks.coffee index 0feba1c746..8f14840e9f 100644 --- a/src/app/tasks.coffee +++ b/src/app/tasks.coffee @@ -43,8 +43,8 @@ module.exports.app = (appExports, model) -> list = model.at "_#{type}List" newModel = model.at('_new' + type.charAt(0).toUpperCase() + type.slice(1)) text = newModel.get() - # Don't add a blank task - if /^(\s)*$/.test(text) + # Don't add a blank task; 20/02/13 Added a check for undefined value, more at issue #463 -lancemanfv + if /^(\s)*$/.test(text) || text == undefined console.error "Task text entered was an empty string." return @@ -171,4 +171,4 @@ module.exports.app = (appExports, model) -> direction = 'up' if direction == 'true/' direction = 'down' if direction == 'false/' task = model.at $(el).parents('li')[0] - scoring.score(task.get('id'), direction) \ No newline at end of file + scoring.score(task.get('id'), direction)