diff --git a/src/org/thoughtcrime/securesms/database/EncryptingSmsDatabase.java b/src/org/thoughtcrime/securesms/database/EncryptingSmsDatabase.java index b566f54d28..db263c0f09 100644 --- a/src/org/thoughtcrime/securesms/database/EncryptingSmsDatabase.java +++ b/src/org/thoughtcrime/securesms/database/EncryptingSmsDatabase.java @@ -24,13 +24,13 @@ import android.util.Pair; import org.thoughtcrime.securesms.crypto.AsymmetricMasterCipher; import org.thoughtcrime.securesms.crypto.AsymmetricMasterSecret; -import org.whispersystems.textsecure.crypto.InvalidMessageException; -import org.whispersystems.textsecure.crypto.MasterCipher; -import org.whispersystems.textsecure.crypto.MasterSecret; import org.thoughtcrime.securesms.database.model.DisplayRecord; import org.thoughtcrime.securesms.sms.IncomingTextMessage; import org.thoughtcrime.securesms.sms.OutgoingTextMessage; import org.thoughtcrime.securesms.util.LRUCache; +import org.whispersystems.textsecure.crypto.InvalidMessageException; +import org.whispersystems.textsecure.crypto.MasterCipher; +import org.whispersystems.textsecure.crypto.MasterSecret; import java.lang.ref.SoftReference; import java.util.Collections; @@ -145,6 +145,10 @@ public class EncryptingSmsDatabase extends SmsDatabase { long type = cursor.getLong(cursor.getColumnIndexOrThrow(SmsDatabase.TYPE)); String ciphertext = cursor.getString(cursor.getColumnIndexOrThrow(SmsDatabase.BODY)); + if (ciphertext == null) { + return new DisplayRecord.Body("", true); + } + try { if (SmsDatabase.Types.isSymmetricEncryption(type)) { String plaintext = plaintextCache.get(ciphertext);