Skip to content

Commit

Permalink
[git-webkit revert] Fix AttributeError when reason is passed in
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=270174
rdar://problem/123698369

Reviewed by Jonathan Bedard.

Error handling for an incorrect issue link should occur *after* checking if it is None.

* Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/revert.py:
(Revert.get_issue_info):

Canonical link: https://commits.webkit.org/275398@main
  • Loading branch information
briannafan committed Feb 27, 2024
1 parent 1decf3d commit 8393b67
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ def get_issue_info(cls, args, repository, commit_objects, commit_issues, **kwarg

issue = Tracker.from_string(args.issue)

if not issue.title:
sys.stderr.write('Could not fetch {} from link. Please verify that the issue exists.\n'.format(issue.tracker.NAME))
return None

# Create a new bug if no issue exists
if not issue and Tracker.instance() and getattr(args, 'update_issue', True):
if getattr(Tracker.instance(), 'credentials', None):
Expand Down Expand Up @@ -139,6 +135,9 @@ def get_issue_info(cls, args, repository, commit_objects, commit_issues, **kwarg
print("Created '{}'".format(issue))
elif not Tracker.instance():
sys.stderr.write('Could not find tracker instance.\n')
elif not issue or not issue.title:
sys.stderr.write('Could not fetch {} from link. Please verify that the issue exists.\n'.format(issue.tracker.NAME))
return None

rdar = Branch.cc_radar(args, repository, issue)
if rdar:
Expand Down

0 comments on commit 8393b67

Please sign in to comment.