Skip to content

Commit dbefde1

Browse files
committed
Handle factory null case
1 parent c384204 commit dbefde1

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

wallet-connect-v2/src/release/kotlin/com.walletconnect.android/di/CoreStorageModule.kt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import android.security.keystore.KeyProperties
99
import android.util.Base64
1010
import androidx.security.crypto.EncryptedSharedPreferences
1111
import androidx.security.crypto.MasterKey
12-
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory
1312
import app.cash.sqldelight.db.QueryResult
1413
import app.cash.sqldelight.db.SqlDriver
1514
import app.cash.sqldelight.db.SqlSchema
@@ -214,12 +213,20 @@ private fun Scope.createSqlDriver(
214213
null,
215214
false
216215
)
217-
return AndroidSqliteDriver(
218-
schema = schema,
219-
context = androidContext(),
220-
name = name,
221-
factory = factory ?: FrameworkSQLiteOpenHelperFactory()
222-
)
216+
return if (factory != null) {
217+
AndroidSqliteDriver(
218+
schema = schema,
219+
context = androidContext(),
220+
name = name,
221+
factory = factory
222+
)
223+
} else {
224+
AndroidSqliteDriver(
225+
schema = schema,
226+
context = androidContext(),
227+
name = name
228+
)
229+
}
223230
}
224231

225232
fun coreStorageModule(storagePrefix: String = String.Empty, bundleId: String) = module {

0 commit comments

Comments
 (0)