forked from cwtch.im/cwtch-ui
Check WorkInfo is Null
This shouldn't happen in normal use, but can happen in debug builds
This commit is contained in:
parent
6859780873
commit
137de57e83
|
@ -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"))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue