fix crash when closing ComposeActivity (#1651)

This commit is contained in:
Konrad Pozniak 2020-01-29 19:15:53 +01:00 committed by GitHub
parent 77fb4df659
commit 7d5a9da992
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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