diff --git a/browser/devtools/styleeditor/styleeditor-panel.js b/browser/devtools/styleeditor/styleeditor-panel.js index ef55e84761e..9940fabd15d 100644 --- a/browser/devtools/styleeditor/styleeditor-panel.js +++ b/browser/devtools/styleeditor/styleeditor-panel.js @@ -72,15 +72,26 @@ StyleEditorPanel.prototype = { * * @param {string} event * Type of event - * @param {string} errorCode + * @param {string} code * Error code of error to report + * @param {string} message + * Extra message to append to error message */ - _showError: function(event, errorCode) { - let message = _(errorCode); + _showError: function(event, code, message) { + if (!this._toolbox) { + // could get an async error after we've been destroyed + return; + } + + let errorMessage = _(code); + if (message) { + errorMessage += " " + message; + } + let notificationBox = this._toolbox.getNotificationBox(); let notification = notificationBox.getNotificationWithValue("styleeditor-error"); if (!notification) { - notificationBox.appendNotification(message, + notificationBox.appendNotification(errorMessage, "styleeditor-error", "", notificationBox.PRIORITY_CRITICAL_LOW); } },