Check if success flag is true before accessing values.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 16 Nov 2010 10:24:31 +0000 (11:24 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 16 Nov 2010 10:24:31 +0000 (11:24 +0100)
src/main/resources/static/javascript/sone.js

index 310e422..a7bfe08 100644 (file)
@@ -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) {