mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 12:38:33 +00:00
Fix migration crash for unregistered users.
This commit is contained in:
@@ -43,8 +43,8 @@ object V185_MessageRecipientsAndEditMessageMigration : SignalDatabaseMigration {
|
|||||||
val selfId: RecipientId? = getSelfId(db)
|
val selfId: RecipientId? = getSelfId(db)
|
||||||
|
|
||||||
if (selfId == null) {
|
if (selfId == null) {
|
||||||
val messageCount = db.rawQuery("SELECT COUNT(*) FROM message").readToSingleInt()
|
val outgoingMessageCount = db.rawQuery("SELECT COUNT(*) FROM message WHERE $outgoingClause").readToSingleInt()
|
||||||
if (messageCount == 0) {
|
if (outgoingMessageCount == 0) {
|
||||||
Log.i(TAG, "Could not find ourselves in the DB! Assuming this is an install that hasn't been registered yet.")
|
Log.i(TAG, "Could not find ourselves in the DB! Assuming this is an install that hasn't been registered yet.")
|
||||||
} else {
|
} else {
|
||||||
throw IllegalStateException("Could not find ourselves in the recipient table, but messages exist in the message table!")
|
throw IllegalStateException("Could not find ourselves in the recipient table, but messages exist in the message table!")
|
||||||
|
|||||||
Reference in New Issue
Block a user