From fd6d947df39ec68036f7ba3af6bb8d538b2284b4 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Wed, 27 Jun 2018 09:43:02 -0700 Subject: [PATCH] Fix ClassCastException in ThreadDatabase. I casted too deep. Forgot about NotificationMmsMessageRecord. --- src/org/thoughtcrime/securesms/database/ThreadDatabase.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/database/ThreadDatabase.java b/src/org/thoughtcrime/securesms/database/ThreadDatabase.java index cd3261631b..ee69117d56 100644 --- a/src/org/thoughtcrime/securesms/database/ThreadDatabase.java +++ b/src/org/thoughtcrime/securesms/database/ThreadDatabase.java @@ -38,6 +38,7 @@ import org.thoughtcrime.securesms.database.RecipientDatabase.RecipientSettings; import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper; import org.thoughtcrime.securesms.database.model.MediaMmsMessageRecord; import org.thoughtcrime.securesms.database.model.MessageRecord; +import org.thoughtcrime.securesms.database.model.MmsMessageRecord; import org.thoughtcrime.securesms.database.model.ThreadRecord; import org.thoughtcrime.securesms.mms.Slide; import org.thoughtcrime.securesms.mms.SlideDeck; @@ -586,8 +587,8 @@ public class ThreadDatabase extends Database { } private @NonNull String getFormattedBodyFor(@NonNull MessageRecord messageRecord) { - if (messageRecord.isMms() && ((MediaMmsMessageRecord) messageRecord).getSharedContacts().size() > 0) { - Contact contact = ((MediaMmsMessageRecord) messageRecord).getSharedContacts().get(0); + if (messageRecord.isMms() && ((MmsMessageRecord) messageRecord).getSharedContacts().size() > 0) { + Contact contact = ((MmsMessageRecord) messageRecord).getSharedContacts().get(0); return ContactUtil.getStringSummary(context, contact).toString(); }