Check for status "type" before casting (class cast exception Placeholder) (#3203)

* Check for status "type" before casting.

* Update app/src/main/java/com/keylesspalace/tusky/components/viewthread/ViewThreadViewModel.kt

Co-authored-by: Nik Clayton <nik@ngo.org.uk>

* Make sure no placeholder is returned as status

---------

Co-authored-by: Nik Clayton <nik@ngo.org.uk>
This commit is contained in:
UlrichKu 2023-01-27 19:48:48 +01:00 committed by GitHub
parent c31e5345dc
commit ce3d6f2f8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -71,7 +71,8 @@ rb.emojis as 'rb_emojis', rb.bot as 'rb_bot'
FROM TimelineStatusEntity s
LEFT JOIN TimelineAccountEntity a ON (s.timelineUserId = a.timelineUserId AND s.authorServerId = a.serverId)
LEFT JOIN TimelineAccountEntity rb ON (s.timelineUserId = rb.timelineUserId AND s.reblogAccountId = rb.serverId)
WHERE s.serverId = :statusId OR s.reblogServerId = :statusId"""
WHERE (s.serverId = :statusId OR s.reblogServerId = :statusId)
AND s.authorServerId IS NOT NULL"""
)
abstract suspend fun getStatus(statusId: String): TimelineStatusWithAccount?