diff --git a/src/message_window.py b/src/message_window.py
index 53d8dfa8bf29123eb5bd782ab6a30ecede9cdf25..cbdaa6e3969932b228e5f7d29b6638d5c24199d3 100644
--- a/src/message_window.py
+++ b/src/message_window.py
@@ -1035,7 +1035,7 @@ class MessageWindowMgr(gobject.GObject):
 		'''Same as get_control. Was briefly required, is not any more.
 May be useful some day in the future?'''
 		ctrl = self.get_control(jid, acct)
-		if ctrl.type_id == message_control.TYPE_GC:
+		if ctrl and ctrl.type_id == message_control.TYPE_GC:
 			return ctrl
 		return None