From bb2637b95c6f7e2be9a7bfe7f0709dac8614e32c Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Sat, 5 Sep 2009 18:19:19 +0200
Subject: [PATCH] prevent a traceback when upgrading

---
 src/common/optparser.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/common/optparser.py b/src/common/optparser.py
index 18cfe28028..bc455e1f65 100644
--- a/src/common/optparser.py
+++ b/src/common/optparser.py
@@ -659,9 +659,10 @@ class OptionsParser:
 	def update_config_to_01214(self):
 		for status in ['online', 'chat', 'away', 'xa', 'dnd', 'invisible',
 		'offline']:
-			gajim.config.add_per('statusmsg', '_last_' + status)
-			gajim.config.set_per('statusmsg', '_last_' + status, 'message',
-				self.old_values['last_status_msg_' + status])
+			if 'last_status_msg_' + status in self.old_values:
+				gajim.config.add_per('statusmsg', '_last_' + status)
+				gajim.config.set_per('statusmsg', '_last_' + status, 'message',
+					self.old_values['last_status_msg_' + status])
 		gajim.config.set('version', '0.12.1.4')
 
 	def update_config_to_01215(self):
-- 
GitLab