[brubru] don't fail when open pref window with no accoutn configured. Fixes #4895
This commit is contained in:
parent
5301dcd4a0
commit
5bc09c2a6a
|
@ -522,8 +522,11 @@ class PreferencesWindow:
|
||||||
self.window.hide()
|
self.window.hide()
|
||||||
|
|
||||||
def get_per_account_option(self, opt):
|
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"'''
|
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
|
val = None
|
||||||
for account in gajim.connections:
|
for account in gajim.connections:
|
||||||
v = gajim.config.get_per('accounts', account, opt)
|
v = gajim.config.get_per('accounts', account, opt)
|
||||||
|
|
Loading…
Reference in New Issue