Check WorkInfo is not Null #374

Merged
dan merged 2 commits from cwtch1.6.1-fixes into trunk 2022-02-16 23:58:45 +00:00
1 changed files with 1 additions and 1 deletions
Showing only changes of commit 137de57e83 - Show all commits

View File

@ -218,7 +218,7 @@ class MainActivity: FlutterActivity() {
WorkManager.getInstance(this).enqueue(workRequest)
WorkManager.getInstance(applicationContext).getWorkInfoByIdLiveData(workRequest.id).observe(
this, Observer { workInfo ->
if (workInfo.state == WorkInfo.State.SUCCEEDED) {
if (workInfo != null && workInfo.state == WorkInfo.State.SUCCEEDED) {
val res = workInfo.outputData.keyValueMap.toString()
result.success(workInfo.outputData.getString("result"))
}