fix diff expand error on empty response

This commit is contained in:
Eduard Heimbuch
2020-07-09 11:50:13 +02:00
parent 172498ca80
commit efc7ece0fe
2 changed files with 2 additions and 1 deletions

View File

@@ -63,7 +63,7 @@ class DiffExpander {
return 0;
}
const changes = this.file.hunks![n].changes;
if (changes[changes.length - 1].type === "normal") {
if (changes[changes.length - 1]?.type === "normal") {
if (n === this.file!.hunks!.length - 1) {
return this.file!.hunks![this.file!.hunks!.length - 1].fullyExpanded ? 0 : -1;
}