From d055060483ee79eafaa5729a2ee09c46e8028fe3 Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Thu, 7 Apr 2022 22:57:32 +0200 Subject: [PATCH] Fixed crash on empty graph --- src/main/kotlin/app/git/TabState.kt | 2 +- src/main/kotlin/app/git/graph/GraphCommitList.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/git/TabState.kt b/src/main/kotlin/app/git/TabState.kt index 69a070a..0d302ac 100644 --- a/src/main/kotlin/app/git/TabState.kt +++ b/src/main/kotlin/app/git/TabState.kt @@ -75,7 +75,7 @@ class TabState @Inject constructor( ex.printStackTrace() if (showError) - errorsManager.addError(newErrorNow(ex, ex.localizedMessage)) + errorsManager.addError(newErrorNow(ex, ex.message.orEmpty())) } finally { _processing.value = false diff --git a/src/main/kotlin/app/git/graph/GraphCommitList.kt b/src/main/kotlin/app/git/graph/GraphCommitList.kt index f29b89e..28233fe 100644 --- a/src/main/kotlin/app/git/graph/GraphCommitList.kt +++ b/src/main/kotlin/app/git/graph/GraphCommitList.kt @@ -351,6 +351,8 @@ class GraphCommitList : RevCommitList() { } fun calcMaxLine() { - maxLine = this.maxOf { it.lane.position } + if(this.isNotEmpty()) { + maxLine = this.maxOf { it.lane.position } + } } } \ No newline at end of file