fix(linux): Fix crash if query doesn't contain bcp47 tag (#4800)

(cherry picked from commit c9de93d478)
This commit is contained in:
Eberhard Beilharz 2021-03-26 19:34:02 +01:00
parent a07d58eaaf
commit 5c1c114e5d
No known key found for this signature in database
GPG key ID: 64A39A9E98B53105

View file

@ -47,9 +47,10 @@ def download_and_install_package(url):
def _extract_bcp47(query):
if query:
queryStrings = parse_qs(query)
values = queryStrings['bcp47']
if len(values) > 0:
return values[0]
if 'bcp47' in queryStrings:
values = queryStrings['bcp47']
if len(values) > 0:
return values[0]
return ''