From 03baa418a335561eddecd0fd5d4793ceb5d1d036 Mon Sep 17 00:00:00 2001 From: PranavPurwar Date: Mon, 17 Jul 2023 22:05:22 +0530 Subject: [PATCH] Fix a critical bug on destroying GitFragment when users don't setup git Signed-off-by: PranavPurwar --- README.md | 5 +++++ .../kotlin/org/cosmicide/rewrite/fragment/GitFragment.kt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 34828386..8c0d2eb7 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,11 @@ Cosmic IDE is a powerful and feature-rich IDE for JVM development on Android. It the latest technologies, and offers a wide range of features that make it the perfect tool for developers who want to build high-quality, bug-free applications. +## Installation + +Currently Cosmic IDE Rewrite is in beta stage, and there is no stable release yet. You can download +the app from [here]( + ## Features * Supports Java 17 and Kotlin 2.1 diff --git a/app/src/main/kotlin/org/cosmicide/rewrite/fragment/GitFragment.kt b/app/src/main/kotlin/org/cosmicide/rewrite/fragment/GitFragment.kt index 4454a7de..137f25c5 100644 --- a/app/src/main/kotlin/org/cosmicide/rewrite/fragment/GitFragment.kt +++ b/app/src/main/kotlin/org/cosmicide/rewrite/fragment/GitFragment.kt @@ -218,7 +218,7 @@ class GitFragment : BaseBindingFragment() { override fun onDestroyView() { super.onDestroyView() - repository.git.close() + if (this::repository.isInitialized) repository.git.close() } fun catchException(code: suspend () -> Unit) {