commit | 5704813b064370530b15b440ef1b949ca963282c | [log] [tgz] |
---|---|---|
author | Joey Mou <[email protected]> | Fri Feb 26 22:17:55 2021 |
committer | Chromium LUCI CQ <[email protected]> | Fri Feb 26 22:17:55 2021 |
tree | 3ad1394e27e8f4f7403be7e164fc41d7f766cf87 | |
parent | e9630e8501b83d95bf2aac1c5894afe2eda30251 [diff] [blame] |
PRESUBMIT: Add safe guard for gerrit value in PRESUBMIT This change will add a safe guard for gerrit value in PRESUBMIT.py to avoid NoneType object error and be more robust. [email protected] Bug: 1167342 Change-Id: I4758e10244a1441479b0a87f631f591c5124278f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2719527 Reviewed-by: Edward Lesmes <[email protected]> Reviewed-by: Dirk Pranke <[email protected]> Commit-Queue: Edward Lesmes <[email protected]> Cr-Commit-Position: refs/heads/master@{#858300}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index f5c00e6..ec9461e3 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -2310,6 +2310,11 @@ target file or directory, to avoid layering violations from being introduced. This check verifies that this happens. """ + # We rely on Gerrit's code-owners to check approvals. + # input_api.gerrit is always set for Chromium, but other projects + # might not use Gerrit. + if not input_api.gerrit: + return [] if input_api.change.issue: # Skip OWNERS check when Bot-Commit label is approved. This label is # intended for commits made by trusted bots that don't require review nor