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

@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed file extension detection with new spotter version - Fixed file extension detection with new spotter version
- Fixed wrong cache directory location ([#1236](https://github.com/scm-manager/scm-manager/issues/1236) and [#1242](https://github.com/scm-manager/scm-manager/issues/1242)) - Fixed wrong cache directory location ([#1236](https://github.com/scm-manager/scm-manager/issues/1236) and [#1242](https://github.com/scm-manager/scm-manager/issues/1242))
- Fixed error in update step ([#1237](https://github.com/scm-manager/scm-manager/issues/1237) and [#1244](https://github.com/scm-manager/scm-manager/issues/1244)) - Fixed error in update step ([#1237](https://github.com/scm-manager/scm-manager/issues/1237) and [#1244](https://github.com/scm-manager/scm-manager/issues/1244))
- Fixed error on empty diff expand response ([#1247](https://github.com/scm-manager/scm-manager/pull/1247))
## [2.2.0] - 2020-07-03 ## [2.2.0] - 2020-07-03
### Added ### Added

View File

@@ -63,7 +63,7 @@ class DiffExpander {
return 0; return 0;
} }
const changes = this.file.hunks![n].changes; 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) { if (n === this.file!.hunks!.length - 1) {
return this.file!.hunks![this.file!.hunks!.length - 1].fullyExpanded ? 0 : -1; return this.file!.hunks![this.file!.hunks!.length - 1].fullyExpanded ? 0 : -1;
} }