File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
AnkiDroid/src/main/java/com/ichi2/anki Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import androidx.annotation.VisibleForTesting
2626import androidx.core.app.TaskStackBuilder
2727import androidx.core.content.FileProvider
2828import androidx.core.content.IntentCompat
29+ import androidx.work.WorkManager
2930import com.ichi2.anki.common.annotations.NeedsTest
3031import com.ichi2.anki.common.utils.trimToLength
3132import com.ichi2.anki.dialogs.DialogHandler.Companion.storeMessage
@@ -78,7 +79,10 @@ class IntentHandler : AbstractIntentHandler() {
7879 val launchType = getLaunchType(intent)
7980 // TODO block the UI with some kind of ProgressDialog instead of cancelling the sync work
8081 if (requiresCollectionAccess(launchType)) {
81- SyncWorker .cancel(this )
82+ // # 18899
83+ if (WorkManager .isInitialized()) {
84+ SyncWorker .cancel(this )
85+ }
8286 }
8387 when (launchType) {
8488 LaunchType .FILE_IMPORT ->
You can’t perform that action at this time.
0 commit comments