Prevent crash

This commit is contained in:
M66B 2020-08-10 08:33:41 +02:00
parent 9324bee13c
commit 7cf97eeaf9
1 changed files with 7 additions and 3 deletions

View File

@ -147,9 +147,13 @@ public class WorkerFts extends Worker {
}
static void cancel(Context context) {
Log.i("Cancelling " + getName());
WorkManager.getInstance(context).cancelUniqueWork(getName());
Log.i("Cancelled " + getName());
try {
Log.i("Cancelling " + getName());
WorkManager.getInstance(context).cancelUniqueWork(getName());
Log.i("Cancelled " + getName());
} catch (IllegalStateException ex) {
Log.w(ex);
}
}
private static String getName() {