]> git.ktnx.net Git - mobile-ledger.git/commitdiff
if(!isCancelled) → throwIfCancelled()
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 5 Jan 2019 12:12:38 +0000 (12:12 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 5 Jan 2019 12:12:38 +0000 (12:12 +0000)
app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java

index cf3e476d10ec41499147c49fca3fa784c0225640..601e7eca3c5740cedc1bd4e9100de9c83b326bdc 100644 (file)
@@ -302,10 +302,11 @@ public class RetrieveTransactionsTask extends
                                             String.format("Unknown parser updating %s", state.name()));
                             }
                         }
-                        if (!isCancelled()) {
-                            db.execSQL("DELETE FROM transactions WHERE keep = 0");
-                            db.setTransactionSuccessful();
-                        }
+
+                        throwIfCancelled();
+
+                        db.execSQL("DELETE FROM transactions WHERE keep = 0");
+                        db.setTransactionSuccessful();
                     }
                     finally {
                         db.endTransaction();