mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-25 19:29:54 +01:00
Add better error handling for empty story text post.
This commit is contained in:
@@ -83,7 +83,13 @@ class StoryPostViewModel(private val repository: StoryTextPostRepository) : View
|
|||||||
val text: StoryTextPost = if (record.body.isNotEmpty()) {
|
val text: StoryTextPost = if (record.body.isNotEmpty()) {
|
||||||
StoryTextPost.ADAPTER.decode(Base64.decode(record.body))
|
StoryTextPost.ADAPTER.decode(Base64.decode(record.body))
|
||||||
} else {
|
} else {
|
||||||
throw Exception("Text post message body is empty.")
|
Log.w(TAG, "Failed to decode empty story text post body.")
|
||||||
|
store.update {
|
||||||
|
StoryPostState.TextPost(
|
||||||
|
loadState = StoryPostState.LoadState.FAILED
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return@subscribeBy
|
||||||
}
|
}
|
||||||
|
|
||||||
val linkPreview = record.linkPreviews.firstOrNull()
|
val linkPreview = record.linkPreviews.firstOrNull()
|
||||||
|
|||||||
Reference in New Issue
Block a user