New tool: annotations from current text (fixes #862)
[redakcja.git] / redakcja / static / js / wiki / view_editor_wysiwyg.js
index dc24aea..2beb4d4 100644 (file)
                 _finalize(success);
             },
             error: function(text, source){
-                $('#html-view').html('<p class="error">Wystąpił błąd:</p><p>'+text+'</p><pre>'+source.replace(/&/g, '&amp;').replace(/</g, '&lt;')+'</pre>');
+                err = '<p class="error">Wystąpił błąd:</p><p>'+text+'</p>';
+                if (source)
+                    err += '<pre>'+source.replace(/&/g, '&amp;').replace(/</g, '&lt;')+'</pre>'
+                $('#html-view').html(err);
                 _finalize(failure);
             }
         });