diff --git a/app/assets/javascripts/editor.js b/app/assets/javascripts/editor.js index bd16653f..9c511023 100644 --- a/app/assets/javascripts/editor.js +++ b/app/assets/javascripts/editor.js @@ -27,8 +27,10 @@ $(function() { }; var ajaxError = function(response) { + var message = ((response || {}).responseJSON || {}).message || ''; + $.flash.danger({ - text: (response && response.responseJSON && response.responseJSON.message) || $('#flash').data('message-failure') + text: message.length > 0 ? message : $('#flash').data('message-failure') }); };