try{} needs to be immediately after incrementing the background task count
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 7 Mar 2019 04:58:43 +0000 (06:58 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 7 Mar 2019 04:58:43 +0000 (06:58 +0200)
app/src/main/java/net/ktnx/mobileledger/async/UpdateAccountsTask.java

index cff03a2..64a5559 100644 (file)
@@ -31,9 +31,9 @@ import java.util.ArrayList;
 public class UpdateAccountsTask extends AsyncTask<Void, Void, ArrayList<LedgerAccount>> {
     protected ArrayList<LedgerAccount> doInBackground(Void... params) {
         Data.backgroundTaskCount.incrementAndGet();
-        String profileUUID = Data.profile.get().getUuid();
-        boolean onlyStarred = Data.optShowOnlyStarred.get();
         try {
+            String profileUUID = Data.profile.get().getUuid();
+            boolean onlyStarred = Data.optShowOnlyStarred.get();
             ArrayList<LedgerAccount> newList = new ArrayList<>();
 
             String sql = "SELECT name, hidden FROM accounts WHERE profile = ?";