diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2009-11-20 22:32:47 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2009-11-20 22:33:12 +0100 |
commit | d04e62460df0679dd232a265d74e249cf74e5dae (patch) | |
tree | 7e94ffaa42f0c09757b7beed16dd75b8df1c0975 | |
parent | 11a68e62e6d0f858ef7d76f8b7f8809f9ea92a89 (diff) |
JavaScript: Improve robustness.
-rw-r--r-- | logikorr.js | 6 |
1 files changed, 5 insertions, 1 deletions
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) { |