Skip to content

Commit a359f88

Browse files
committed
Add null check for content provider client in JtxSyncManagerTest
1 parent f0b8d10 commit a359f88

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/androidTest/kotlin/at/bitfire/davdroid/sync/JtxSyncManagerTest.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import dagger.hilt.android.testing.HiltAndroidTest
2424
import okhttp3.HttpUrl.Companion.toHttpUrl
2525
import org.junit.After
2626
import org.junit.Assert.assertEquals
27+
import org.junit.Assume.assumeNotNull
2728
import org.junit.Assume.assumeTrue
2829
import org.junit.Before
2930
import org.junit.Rule
@@ -75,7 +76,9 @@ class JtxSyncManagerTest {
7576
assumeTrue(PermissionUtils.havePermissions(context, TaskProvider.PERMISSIONS_JTX))
7677

7778
// Acquire the jtx content provider
78-
provider = context.contentResolver.acquireContentProviderClient(JtxContract.AUTHORITY)!!
79+
val providerOrNull = context.contentResolver.acquireContentProviderClient(JtxContract.AUTHORITY)!!
80+
assumeNotNull(providerOrNull)
81+
provider = providerOrNull
7982

8083
// Create dummy dependencies
8184
val service = Service(0, account.name, Service.TYPE_CALDAV, null)

0 commit comments

Comments
 (0)