diff --git a/src/common/events.py b/src/common/events.py
index c69fc27d1bdcc4a94d6ad9ca3f535a697abf4a56..4e5068652ebf4b8ade9b8fc2c968c43599dc47de 100644
--- a/src/common/events.py
+++ b/src/common/events.py
@@ -163,6 +163,8 @@ class Events:
 		del self._events[account][jid]
 
 	def change_jid(self, account, old_jid, new_jid):
+		if account not in self._events:
+			return
 		if old_jid not in self._events[account]:
 			return
 		if new_jid in self._events[account]: