From d04e62460df0679dd232a265d74e249cf74e5dae Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 20 Nov 2009 22:32:47 +0100 Subject: JavaScript: Improve robustness. --- logikorr.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/logikorr.js b/logikorr.js index c8f0079..111219d 100644 --- a/logikorr.js +++ b/logikorr.js @@ -27,7 +27,11 @@ YUI().use('node-base', 'io-base', 'io-form', 'io-queue', 'json', function (Y) { Y.log(scoreCell); function doUpdate(id, o, args) { var data = o.responseText; - var student = Y.JSON.parse(data); + try { + var student = Y.JSON.parse(data); + } catch (e) { + return null; + }; Y.log(student); while (scoreCell.firstChild) { -- cgit v1.2.3