From 5bc09c2a6ae888beb888e3b30f8e854b0b685c58 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Wed, 11 Mar 2009 09:40:08 +0000
Subject: [PATCH] [brubru] don't fail when open pref window with no accoutn
 configured. Fixes #4895

---
 src/config.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/config.py b/src/config.py
index a4e85cec02..ce255bc76c 100644
--- a/src/config.py
+++ b/src/config.py
@@ -522,8 +522,11 @@ class PreferencesWindow:
 			self.window.hide()
 
 	def get_per_account_option(self, opt):
-		'''Return the value of the option opt if it's the same in all accoutns
+		'''Return the value of the option opt if it's the same in all accounts
 		else returns "mixed"'''
+		if len(gajim.connections) = 0:
+			# a non existant key return default value
+			return gajim.config.get_per('accounts', '__default__', opt)
 		val = None
 		for account in gajim.connections:
 			v = gajim.config.get_per('accounts', account, opt)
-- 
GitLab