Commit 171c0745 authored by Mohamed Heikal's avatar Mohamed Heikal Committed by Commit Bot

Fix crash were CL has no reviewers

Currently git cl owners tries to fetch the current reviewers of a CL
from gerrit. However, this fails with a KeyError when there are no
reviewers currently. This cl fixes that bug.

Bug: 895722
Change-Id: I78a998ee234d207523aa2cef4b5058ba7cfecbc2
Reviewed-on: https://chromium-review.googlesource.com/c/1330122
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Reviewed-by: 's avatarDirk Pranke <dpranke@chromium.org>
parent e28390cc
......@@ -3156,7 +3156,7 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
def GetReviewers(self):
details = self._GetChangeDetail(['DETAILED_ACCOUNTS'])
return [reviewer['email'] for reviewer in details['reviewers']['REVIEWER']]
return [r['email'] for r in details['reviewers'].get('REVIEWER', [])]
_CODEREVIEW_IMPLEMENTATIONS = {
......
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