From 5820b0e86c4e54508331b3695ee3280e6166ac23 Mon Sep 17 00:00:00 2001 From: Don Turner Date: Wed, 18 Dec 2024 12:25:09 +0000 Subject: [PATCH] Add safe call to WorkInfo (again) --- .../samples/apps/nowinandroid/sync/workers/SyncWorkerTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sync/work/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/sync/workers/SyncWorkerTest.kt b/sync/work/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/sync/workers/SyncWorkerTest.kt index b0d3e724f..481875e69 100644 --- a/sync/work/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/sync/workers/SyncWorkerTest.kt +++ b/sync/work/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/sync/workers/SyncWorkerTest.kt @@ -64,7 +64,7 @@ class SyncWorkerTest { val preRunWorkInfo = workManager.getWorkInfoById(request.id).get() // Assert - assertEquals(WorkInfo.State.ENQUEUED, preRunWorkInfo.state) + assertEquals(WorkInfo.State.ENQUEUED, preRunWorkInfo?.state) // Tells the testing framework that the constraints have been met testDriver.setAllConstraintsMet(request.id)