Add extra guard during db migration.

Relates to #13183
This commit is contained in:
Greyson Parrelli 2024-01-02 10:29:03 -05:00 committed by Clark Chen
parent 1b9cf631be
commit 820a5bc363

View file

@ -66,7 +66,9 @@ object V166_ThreadAndMessageForeignKeys : SignalDatabaseMigration {
Log.w(TAG, "There were $count threads for RecipientId::$recipientId. Merging.", true)
val threads: List<ThreadInfo> = getThreadsByRecipientId(db, cursor.requireLong("thread_recipient_id"))
mergeThreads(db, threads)
if (threads.size > 1) {
mergeThreads(db, threads)
}
}
}
}