Don't crash if AM.xml has no application element

This commit is contained in:
Daniel Martí 2015-11-16 07:21:19 -08:00
parent 97a637b9b4
commit 3a616e2d9f

View file

@ -968,6 +968,8 @@ def fetch_real_name(app_dir, flavours):
logging.debug("fetch_real_name: Checking manifest at " + path) logging.debug("fetch_real_name: Checking manifest at " + path)
xml = parse_xml(path) xml = parse_xml(path)
app = xml.find('application') app = xml.find('application')
if app is None:
continue
if "{http://schemas.android.com/apk/res/android}label" not in app.attrib: if "{http://schemas.android.com/apk/res/android}label" not in app.attrib:
continue continue
label = app.attrib["{http://schemas.android.com/apk/res/android}label"].encode('utf-8') label = app.attrib["{http://schemas.android.com/apk/res/android}label"].encode('utf-8')