From 7d5a9da9924df4239057a35536b1362f555a4b81 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Wed, 29 Jan 2020 19:15:53 +0100 Subject: [PATCH] fix crash when closing ComposeActivity (#1651) --- .../tusky/components/compose/ComposeViewModel.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt b/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt index 0e71596fc..f95042a79 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/compose/ComposeViewModel.kt @@ -58,7 +58,7 @@ class ComposeViewModel private var replyingStatusContent: String? = null internal var startingText: String? = null private var savedTootUid: Int = 0 - private var startingContentWarning: String? = null + private var startingContentWarning: String = "" private var inReplyToId: String? = null private var startingVisibility: Status.Visibility = Status.Visibility.UNKNOWN @@ -191,8 +191,8 @@ class ComposeViewModel val contentWarningChanged = showContentWarning.value!! && !contentWarning.isNullOrEmpty() - && !startingContentWarning!!.startsWith(contentWarning.toString()) - val mediaChanged = media.value!!.isNotEmpty() + && !startingContentWarning.startsWith(contentWarning.toString()) + val mediaChanged = !media.value.isNullOrEmpty() val pollChanged = poll.value != null return textChanged || contentWarningChanged || mediaChanged || pollChanged