From 4db4a86420d9dd6e83489221b40f8bf828b0662e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sun, 7 Jun 2015 14:02:50 +0200 Subject: [PATCH] Always make sure that we don't encode None Apparently, we can have a non-nil element that has a nil text. --- fdroidserver/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ''