Add undefined check to _paramsChanged
Change-Id: I65e05df2e00f13028c5a8501d3b6bc32d6cd7a09
This commit is contained in:
@@ -562,7 +562,7 @@
|
|||||||
* @return {?Object}
|
* @return {?Object}
|
||||||
*/
|
*/
|
||||||
_getNavLinkPath(path, fileList, direction, opt_noUp) {
|
_getNavLinkPath(path, fileList, direction, opt_noUp) {
|
||||||
if (!path || fileList.length === 0) { return null; }
|
if (!path || !fileList || fileList.length === 0) { return null; }
|
||||||
|
|
||||||
let idx = fileList.indexOf(path);
|
let idx = fileList.indexOf(path);
|
||||||
if (idx === -1) {
|
if (idx === -1) {
|
||||||
@@ -640,22 +640,24 @@
|
|||||||
promises.push(this._getChangeDetail(this._changeNum).then(change => {
|
promises.push(this._getChangeDetail(this._changeNum).then(change => {
|
||||||
let commit;
|
let commit;
|
||||||
let baseCommit;
|
let baseCommit;
|
||||||
for (const commitSha in change.revisions) {
|
if (change) {
|
||||||
if (!change.revisions.hasOwnProperty(commitSha)) continue;
|
for (const commitSha in change.revisions) {
|
||||||
const revision = change.revisions[commitSha];
|
if (!change.revisions.hasOwnProperty(commitSha)) continue;
|
||||||
const patchNum = revision._number.toString();
|
const revision = change.revisions[commitSha];
|
||||||
if (patchNum === this._patchRange.patchNum) {
|
const patchNum = revision._number.toString();
|
||||||
commit = commitSha;
|
if (patchNum === this._patchRange.patchNum) {
|
||||||
const commitObj = revision.commit || {};
|
commit = commitSha;
|
||||||
const parents = commitObj.parents || [];
|
const commitObj = revision.commit || {};
|
||||||
if (this._patchRange.basePatchNum === PARENT && parents.length) {
|
const parents = commitObj.parents || [];
|
||||||
baseCommit = parents[parents.length - 1].commit;
|
if (this._patchRange.basePatchNum === PARENT && parents.length) {
|
||||||
|
baseCommit = parents[parents.length - 1].commit;
|
||||||
|
}
|
||||||
|
} else if (patchNum === this._patchRange.basePatchNum) {
|
||||||
|
baseCommit = commitSha;
|
||||||
}
|
}
|
||||||
} else if (patchNum === this._patchRange.basePatchNum) {
|
|
||||||
baseCommit = commitSha;
|
|
||||||
}
|
}
|
||||||
|
this._commitRange = {commit, baseCommit};
|
||||||
}
|
}
|
||||||
this._commitRange = {commit, baseCommit};
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
promises.push(this._loadComments());
|
promises.push(this._loadComments());
|
||||||
|
|||||||
Reference in New Issue
Block a user