Permalink
Browse files

When processing included_manifests skip any empty items in the array.…

… Prevents an unexpected error leading to a crash with some webserver confiugurations
  • Loading branch information...
gregneagle committed Jan 10, 2018
1 parent 7619641 commit 7fa67a2936875d211766669aa8d1e3c2e7f19a27
Showing with 17 additions and 7 deletions.
  1. +17 −7 code/client/munkilib/updatecheck/analyze.py
@@ -370,6 +370,15 @@ def process_install(manifestitem, cataloglist, installinfo,
iteminfo['display_name'] = item_pl.get('display_name', iteminfo['name'])
iteminfo['description'] = item_pl.get('description', '')

<<<<<<< Local Changes
<<<<<<< Local Changes
=======
if item_pl.get('localized_strings'):
iteminfo['localized_strings'] = item_pl['localized_strings']

>>>>>>> External Changes
=======
>>>>>>> External Changes
if not dependencies_met:
display.display_warning(
'Didn\'t attempt to install %s because could not resolve all '
@@ -643,13 +652,14 @@ def process_manifest_for_key(manifest, manifest_key, installinfo,
return

for item in manifestdata.get('included_manifests', []):
nestedmanifestpath = manifestutils.get_manifest(item)
if not nestedmanifestpath:
raise manifestutils.ManifestException
if processes.stop_requested():
return {}
process_manifest_for_key(nestedmanifestpath, manifest_key,
installinfo, cataloglist)
if item: # only process if item is not empty
nestedmanifestpath = manifestutils.get_manifest(item)
if not nestedmanifestpath:
raise manifestutils.ManifestException
if processes.stop_requested():
return {}
process_manifest_for_key(nestedmanifestpath, manifest_key,
installinfo, cataloglist)

conditionalitems = manifestdata.get('conditional_items', [])
if conditionalitems:

0 comments on commit 7fa67a2

Please sign in to comment.