From 6466002052bafa47f01d470a9a85201406aead1c Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 22 May 2014 01:27:23 +0800 Subject: [PATCH] [ticket/12572] Fix JS error when alert message title is undefined JS console reports error in core.js: TypeError: alert is undefined alert.hide() when res.MESSAGE_TITLE is undefined. PHPBB3-12572 --- phpBB/assets/javascript/core.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index cd633ed2ae..3cb41039cf 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -333,7 +333,9 @@ phpbb.ajaxify = function(options) { // Hide the alert even if we refresh the page, in case the user // presses the back button. dark.fadeOut(phpbb.alertTime, function() { - alert.hide(); + if (typeof alert !== 'undefined') { + alert.hide(); + } }); }, res.REFRESH_DATA.time * 1000); // Server specifies time in seconds }