From ce3d6f2f8f5109d1fe63cb4a82b5aaee7a1bde8b Mon Sep 17 00:00:00 2001 From: UlrichKu Date: Fri, 27 Jan 2023 19:48:48 +0100 Subject: [PATCH] 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 * Make sure no placeholder is returned as status --------- Co-authored-by: Nik Clayton --- app/src/main/java/com/keylesspalace/tusky/db/TimelineDao.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/db/TimelineDao.kt b/app/src/main/java/com/keylesspalace/tusky/db/TimelineDao.kt index dfd15326a..ddf0c9559 100644 --- a/app/src/main/java/com/keylesspalace/tusky/db/TimelineDao.kt +++ b/app/src/main/java/com/keylesspalace/tusky/db/TimelineDao.kt @@ -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?