Catch IllegalStateException in case EmojiCompat hasn't been initialized yet

Fixes #1371

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2021-06-29 12:56:42 +02:00
parent f9449db82a
commit 3514d6b3fc
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -1270,7 +1270,11 @@ class ChatController(args: Bundle) :
override val title: String override val title: String
get() = get() =
if (currentConversation?.displayName != null) { if (currentConversation?.displayName != null) {
" " + EmojiCompat.get().process(currentConversation?.displayName as CharSequence).toString() try {
" " + EmojiCompat.get().process(currentConversation?.displayName as CharSequence).toString()
} catch (e: IllegalStateException) {
" " + currentConversation?.displayName
}
} else { } else {
"" ""
} }