From d6f4241102f5c95e0ec4d76df8247227257e47a8 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Wed, 28 Oct 2009 20:03:45 +0100
Subject: [PATCH] prevent a traceback which happen with obscure reasons. Fixes
 #5366

---
 src/message_window.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/message_window.py b/src/message_window.py
index f4bf614a23..1b4a8ea379 100644
--- a/src/message_window.py
+++ b/src/message_window.py
@@ -764,6 +764,9 @@ class MessageWindow(object):
 			old_ctrl.set_control_active(False)
 
 		new_ctrl = self._widget_to_control(notebook.get_nth_page(page_num))
+		if not new_ctrl:
+			# This event is sometimes exposed without any reason. see #5366
+			return
 		new_ctrl.set_control_active(True)
 		self.show_title(control = new_ctrl)
 
-- 
GitLab