diff --git a/web/pgadmin/static/js/sqleditor/query_tool_notifications.js b/web/pgadmin/static/js/sqleditor/query_tool_notifications.js
index 181e58d58..37ab6d9bc 100644
--- a/web/pgadmin/static/js/sqleditor/query_tool_notifications.js
+++ b/web/pgadmin/static/js/sqleditor/query_tool_notifications.js
@@ -104,7 +104,7 @@ let queryToolNotifications = {
     });
 
     // Render the grid
-    if (notifications_grid)
+    if (notifications_grid && notifications_panel)
       notifications_panel.$container.find('.sql-editor-notifications').append(notifications_grid.render().el);
   },
 
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index f5519fcdf..7fda62593 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -330,6 +330,16 @@ define('tools.querytool', [
       self.messages_panel = self.docker.findPanels('messages')[0];
       self.notifications_panel = self.docker.findPanels('notifications')[0];
 
+      if (_.isUndefined(self.sql_panel_obj) || _.isUndefined(self.history_panel) ||
+       _.isUndefined(self.data_output_panel) || _.isUndefined(self.explain_panel) ||
+       _.isUndefined(self.messages_panel) || _.isUndefined(self.notifications_panel)) {
+        alertify.alert(
+          gettext('Panel Loading Error'),
+          gettext('Something went wrong while loading the panels.'
+          + ' Please make sure to reset the layout (File > Reset Layout) for the better user experience.')
+        );
+      }
+
       // Refresh Code mirror on SQL panel resize to
       // display its value properly
       self.sql_panel_obj.on(wcDocker.EVENT.RESIZE_ENDED, function() {
