Commit 7de54ef0 authored by Michael Moss's avatar Michael Moss Committed by Commit Bot

Fix handling of potential empty gitiles result.

This fixes an issue introduced by
crrev.com/b40a4514 where a 404 result
might return None contents.

R=agable@google.com, phajdan@google.com

Bug:774355
Change-Id: I993a029adb8d92cb27e043cd3d9b17cc8aee2432
Reviewed-on: https://chromium-review.googlesource.com/717937
Commit-Queue: Michael Moss <mmoss@chromium.org>
Reviewed-by: 's avatarPaweł Hajdan Jr. <phajdan.jr@chromium.org>
parent 9f20d020
...@@ -137,4 +137,6 @@ class Gitiles(recipe_api.RecipeApi): ...@@ -137,4 +137,6 @@ class Gitiles(recipe_api.RecipeApi):
fmt='text', fmt='text',
add_json_log=False, add_json_log=False,
**kwargs) **kwargs)
if step_result.json.output['value'] is None:
return None
return base64.b64decode(step_result.json.output['value']) return base64.b64decode(step_result.json.output['value'])
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
DEPS = [ DEPS = [
'gitiles', 'gitiles',
'recipe_engine/json',
'recipe_engine/properties', 'recipe_engine/properties',
] ]
...@@ -62,6 +63,6 @@ def GenTests(api): ...@@ -62,6 +63,6 @@ def GenTests(api):
) )
+ api.step_data( + api.step_data(
'fetch master:NONEXISTENT', 'fetch master:NONEXISTENT',
api.gitiles.make_encoded_file('') api.json.output({'value': None})
) )
) )
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