From 213321a245aa6f57715985104e96a354594903db Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 3 May 2020 16:05:41 +0300 Subject: [PATCH] ignore refresh request when there is no profile yet --- app/src/main/java/net/ktnx/mobileledger/model/Data.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/model/Data.java b/app/src/main/java/net/ktnx/mobileledger/model/Data.java index 1b659ff7..0539c136 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/Data.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/Data.java @@ -148,8 +148,10 @@ public final class Data { return; } MobileLedgerProfile pr = profile.getValue(); - if (pr == null) - throw new IllegalStateException("No current profile"); + if (pr == null) { + Logger.debug("ui", "Ignoring refresh -- no current profile"); + return; + } retrieveTransactionsTask = new RetrieveTransactionsTask(new WeakReference<>(activity), profile.getValue()); -- 2.39.5