X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/c11ad12846df3142b19a343144fe1d2a82b97569..fd61d32:/src/editor/modules/statusBar/statusBar.js diff --git a/src/editor/modules/statusBar/statusBar.js b/src/editor/modules/statusBar/statusBar.js index 5ad7c6b..0f08c59 100644 --- a/src/editor/modules/statusBar/statusBar.js +++ b/src/editor/modules/statusBar/statusBar.js @@ -22,11 +22,19 @@ return function(sandbox){ }, showAction: function(action) { var state = action.getState(), + description; + + if(!state) { + description = gettext('error :('); + logger.error('Got undefined action state: ' + action.name); + } else { description = state.description; - if(!description) { - description = state.allowed ? gettext('Undescribed action') : gettext('Action not allowed'); - logger.info('Undescribed action: ' + action.name); + if(!description) { + description = state.allowed ? gettext('Undescribed action') : gettext('Action not allowed'); + logger.info('Undescribed action: ' + action.name); + } } + view.text(description); if(!state.allowed) { view.prepend('!');