Skip bitbucket pushes without any commits

Fixes 178220183/
This commit is contained in:
Joseph Schorr 2017-03-20 18:23:21 -04:00
parent 4cb8412fd8
commit 6476488221
4 changed files with 90 additions and 2 deletions

View file

@ -62,7 +62,12 @@ class JSONPathDict(object):
def get(self, path, not_found_handler=None):
""" Returns the value found at the given path. Path is a json-path expression. """
jsonpath_expr = parse(path)
matches = jsonpath_expr.find(self._object)
try:
matches = jsonpath_expr.find(self._object)
except IndexError:
return None
if not matches:
return not_found_handler() if not_found_handler else None