Fix code that caused changes to break in MS Edge
There was an exception due to calling Object.keys on an undefined value
that caused a promise to fail to resolve.
This resulted in 'loading' not getting set to false, and the change was
never visible.
Compounded with this error is the fact that gr-error-manager did not
pick up on this exception, because unhandledrejection does not work in
Edge (or firefox), which is used in gr-reporting to catch errors.
Bug: Issue 7896
Bug: Issue 9674
Change-Id: I12a99e3acc1dc1e3592a0d5995f937eccafa4c1c
(cherry picked from commit 935c7550e348bb94bac2b5073d17304f9d90ab7b)
diff --git a/polygerrit-ui/app/elements/change/gr-label-score-row/gr-label-score-row.js b/polygerrit-ui/app/elements/change/gr-label-score-row/gr-label-score-row.js
index dd0bccc..82664f8 100644
--- a/polygerrit-ui/app/elements/change/gr-label-score-row/gr-label-score-row.js
+++ b/polygerrit-ui/app/elements/change/gr-label-score-row/gr-label-score-row.js
@@ -62,7 +62,7 @@
},
_computeBlankItems(permittedLabels, label, side) {
- if (!permittedLabels || !permittedLabels[label] ||
+ if (!permittedLabels || !permittedLabels[label] || !this.labelValues ||
!Object.keys(this.labelValues).length) {
return [];
}