From: David ‘Bombe’ Roden Date: Tue, 16 Nov 2010 10:24:31 +0000 (+0100) Subject: Check if success flag is true before accessing values. X-Git-Tag: 0.3-RC1~39 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=845b4d3af981ae2974528273769ff3d8b1f90ccf;p=Sone.git Check if success flag is true before accessing values. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 310e422..a7bfe08 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -110,7 +110,7 @@ function addCommentLink(postId, element) { */ function getTranslation(key, callback) { $.getJSON("ajax/getTranslation.ajax", {"key": key}, function(data, textStatus) { - if (data != null) { + if ((data != null) && data.success) { callback(data.value); } }, function(xmlHttpRequest, textStatus, error) {