]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
wipe retrieval progress when transaction retrieval is stopped
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / MainActivity.java
index 7df18278515ab2d1c548cb1ee5288343d2c210f1..c917bb9e1c8d53abc25a5e1ad0189ae49b0bcd02 100644 (file)
@@ -615,14 +615,16 @@ public class MainActivity extends ProfileThemedActivity implements FabManager.Fa
             b.transactionProgressLayout.setVisibility(View.GONE);
         }
     }
             b.transactionProgressLayout.setVisibility(View.GONE);
         }
     }
-    public void onRetrieveProgress(RetrieveTransactionsTask.Progress progress) {
-        if (progress.getState() == RetrieveTransactionsTask.ProgressState.FINISHED) {
+    public void onRetrieveProgress(@Nullable RetrieveTransactionsTask.Progress progress) {
+        if (progress == null ||
+            progress.getState() == RetrieveTransactionsTask.ProgressState.FINISHED)
+        {
             Logger.debug("progress", "Done");
             b.transactionProgressLayout.setVisibility(View.GONE);
 
             mainModel.transactionRetrievalDone();
 
             Logger.debug("progress", "Done");
             b.transactionProgressLayout.setVisibility(View.GONE);
 
             mainModel.transactionRetrievalDone();
 
-            String error = progress.getError();
+            String error = (progress == null) ? null : progress.getError();
             if (error != null) {
                 if (error.equals(RetrieveTransactionsTask.Result.ERR_JSON_PARSER_ERROR))
                     error = getResources().getString(R.string.err_json_parser_error);
             if (error != null) {
                 if (error.equals(RetrieveTransactionsTask.Result.ERR_JSON_PARSER_ERROR))
                     error = getResources().getString(R.string.err_json_parser_error);