subiquity/controllers: fix failure when LANG is unset
Do not crash when LANG is unset. Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
This commit is contained in:
parent
291e1950ba
commit
60b455701b
|
@ -37,7 +37,7 @@ class WelcomeController(SubiquityController):
|
|||
|
||||
def start(self):
|
||||
lang = os.environ.get("LANG")
|
||||
if lang.endswith(".UTF-8"):
|
||||
if lang is not None and lang.endswith(".UTF-8"):
|
||||
lang = lang.rsplit('.', 1)[0]
|
||||
for code, name in self.model.supported_languages:
|
||||
if code == lang:
|
||||
|
|
Loading…
Reference in New Issue