File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
app/src/main/java/com/infomaniak/mail/data/cache Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 1818package com.infomaniak.mail.data.cache
1919
2020import android.content.Context
21+ import com.infomaniak.lib.core.utils.SentryLog
2122import com.infomaniak.mail.data.models.AppSettings
23+ import com.infomaniak.mail.data.models.AppSettings.Companion.DEFAULT_ID
2224import com.infomaniak.mail.data.models.Attachment
2325import com.infomaniak.mail.data.models.Bimi
2426import com.infomaniak.mail.data.models.Folder
@@ -229,12 +231,15 @@ object RealmDatabase {
229231 .migration(MAILBOX_INFO_MIGRATION )
230232 .build()
231233
232- fun mailboxContent (mailboxId : Int , userId : Int ) = RealmConfiguration
233- .Builder (mailboxContentSet)
234- .name(mailboxContentDbName(userId, mailboxId))
235- .schemaVersion(MAILBOX_CONTENT_SCHEMA_VERSION )
236- .migration(MAILBOX_CONTENT_MIGRATION )
237- .build()
234+ fun mailboxContent (mailboxId : Int , userId : Int ): RealmConfiguration {
235+ if (mailboxId == DEFAULT_ID ) SentryLog .e(TAG , " RealmConfiguration problem with mailbox content, default ID is used." )
236+
237+ return RealmConfiguration .Builder (mailboxContentSet)
238+ .name(mailboxContentDbName(userId, mailboxId))
239+ .schemaVersion(MAILBOX_CONTENT_SCHEMA_VERSION )
240+ .migration(MAILBOX_CONTENT_MIGRATION )
241+ .build()
242+ }
238243 // endregion
239244 }
240245}
You can’t perform that action at this time.
0 commit comments