Protection from crashing on a bad lang name

svn: r14312
This commit is contained in:
Doug Blank 2010-02-11 12:18:01 +00:00
parent 36281cc5e4
commit 2e038d405e

View File

@ -1821,7 +1821,10 @@ def get_relationship_calculator(reinit=False):
lang = locale.getlocale()[0]
if not lang:
# if lang is empty/None
lang = locale.getdefaultlocale()[0]
try:
lang = locale.getdefaultlocale()[0]
except:
pass
for plugin in PluginRegister.get_instance().relcalc_plugins():
if lang in plugin.lang_list:
pmgr = BasePluginManager.get_instance()