commit | a929aeae91aaf9a3e2815deb56297a88fc286e55 | [log] [tgz] |
---|---|---|
author | Dhruv Srivastava <dhruvsri@google.com> | Thu Nov 26 14:25:24 2020 +0100 |
committer | Dhruv Srivastava <dhruvsri@google.com> | Thu Nov 26 14:25:24 2020 +0100 |
tree | 1e6a69865fa6992f89b760ec3079a4067c667a63 | |
parent | 6f298cfa74da203ffe6a12d9bf8979a0e29a5637 [diff] |
Check if code-review is part of permitted_labels If code review is not part of permitted_labels, then trying to slice undefined throws an error and the page doesn't load. Change-Id: Ic9a1dadcef8c013cc10524a92d26857c20d62db8
diff --git a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.ts b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.ts index 20fbc32..9473700 100644 --- a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.ts +++ b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.ts
@@ -954,7 +954,9 @@ if ( !result && this.change.labels[CODE_REVIEW] && - this._getLabelStatus(this.change.labels[CODE_REVIEW]) === LabelStatus.OK + this._getLabelStatus(this.change.labels[CODE_REVIEW]) === + LabelStatus.OK && + this.change.permitted_labels[CODE_REVIEW] ) { result = CODE_REVIEW; }