Check if success flag is true before accessing values.
[Sone.git] / 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) {