1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 00:40:11 +01:00

Always make sure that we don't encode None

Apparently, we can have a non-nil element that has a nil text.
This commit is contained in:
Daniel Martí 2015-06-07 14:02:50 +02:00
parent f9b7a260af
commit 4db4a86420

View File

@ -888,7 +888,7 @@ def retrieve_string(app_dir, string, xmlfiles=None):
continue continue
xml = parse_xml(path) xml = parse_xml(path)
element = xml.find('string[@name="' + name + '"]') element = xml.find('string[@name="' + name + '"]')
if element is not None: if element is not None and element.text is not None:
return retrieve_string(app_dir, element.text.encode('utf-8'), xmlfiles) return retrieve_string(app_dir, element.text.encode('utf-8'), xmlfiles)
return '' return ''