From efc7ece0feb337d50bab3e43694960bbda2c749b Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Thu, 9 Jul 2020 11:50:13 +0200 Subject: [PATCH] fix diff expand error on empty response --- CHANGELOG.md | 1 + scm-ui/ui-components/src/repos/DiffExpander.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2390615657..fcc80cb295 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 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 on empty diff expand response ([#1247](https://github.com/scm-manager/scm-manager/pull/1247)) ## [2.2.0] - 2020-07-03 ### Added diff --git a/scm-ui/ui-components/src/repos/DiffExpander.ts b/scm-ui/ui-components/src/repos/DiffExpander.ts index 63ec2b6c6d..fea69316f5 100644 --- a/scm-ui/ui-components/src/repos/DiffExpander.ts +++ b/scm-ui/ui-components/src/repos/DiffExpander.ts @@ -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; }