Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2708)

Unified Diff: build/android/gyp/util/md5_check.py

Issue 1402473002: Fix md5_check.py crashing when adding a new zip file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/util/md5_check.py
diff --git a/build/android/gyp/util/md5_check.py b/build/android/gyp/util/md5_check.py
index 2ddc3ac48a18f1e4c3e9f11178f6d88da1461709..a68bdc9d3699990d86d0519a642055e74b3ee0a3 100644
--- a/build/android/gyp/util/md5_check.py
+++ b/build/android/gyp/util/md5_check.py
@@ -340,9 +340,12 @@ class _Metadata(object):
def IterSubpaths(self, path):
"""Returns a generator for all subpaths in the given zip.
- If the given path is not a zip file, returns an empty generator.
+ If the given path is not a zip file or doesn't exist, returns an empty
+ iterable.
"""
outer_entry = self._GetEntry(path)
+ if not outer_entry:
+ return ()
subentries = outer_entry.get('entries', [])
return (entry['path'] for entry in subentries)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698