Commit bc2287b0 authored by agrieve's avatar agrieve Committed by Commit bot

Fix resource_sizes.py when no pak files exist.

It was crashing due to StopIteration exception

BUG=671803

Review-Url: https://codereview.chromium.org/2565303003
Cr-Commit-Position: refs/heads/master@{#437945}
parent 540eb541
......@@ -184,7 +184,8 @@ class _FileGroup(object):
return len(self._zip_infos)
def FindByPattern(self, pattern):
return next(i for i in self._zip_infos if re.match(pattern, i.filename))
return next((i for i in self._zip_infos if re.match(pattern, i.filename)),
None)
def FindLargest(self):
return max(self._zip_infos, key=lambda i: i.file_size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment