From: Daniel Martí Date: Sun, 7 Jun 2015 12:02:50 +0000 (+0200) Subject: Always make sure that we don't encode None X-Git-Tag: 0.4.0~36 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4db4a86420d9dd6e83489221b40f8bf828b0662e;p=fdroidserver.git Always make sure that we don't encode None Apparently, we can have a non-nil element that has a nil text. --- diff --git a/fdroidserver/common.py b/fdroidserver/common.py index c2eb4388..f031b193 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -888,7 +888,7 @@ def retrieve_string(app_dir, string, xmlfiles=None): continue xml = parse_xml(path) 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 ''