PolyGerrit: If change throws null for change then return ''

This is to make sure we doint call change.topic which will throw an null
per below.

I was getting an undefined error

gr-app.js:2746 Uncaught (in promise) TypeError: Cannot read property 'topic' of null
    at gr-app.js:2746
    at <anonymous>

when debugging https://gerrit-review.googlesource.com/#/c/108092/

Change-Id: Ie9802cdf8a601570a6f8352054c8cd042e348792
This commit is contained in:
Paladox none
2017-06-01 15:46:07 +00:00
parent 4d28854369
commit 7229e46133

View File

@@ -923,7 +923,10 @@
return this.$.restAPI.getChangeDetail(this._changeNum,
this._handleGetChangeDetailError.bind(this)).then(
change => {
// Issue 4190: Coalesce missing topics to null.
if (!change) {
return '';
}
// Issue 4190: Coalesce missing topics to null.
if (!change.topic) { change.topic = null; }
if (!change.reviewer_updates) {
change.reviewer_updates = null;