From c6895add1b48e2a920f65e60d39499aca174e8b2 Mon Sep 17 00:00:00 2001 From: "Emmanuele (WolfSolver)" Date: Wed, 27 Nov 2024 12:33:18 +0100 Subject: [PATCH 1/2] Stability: Add not null for Download currency --- .../java/com/money/manager/ex/currency/CurrencyService.java | 5 +++++ app/src/main/res/values/strings.xml | 1 + 2 files changed, 6 insertions(+) diff --git a/app/src/main/java/com/money/manager/ex/currency/CurrencyService.java b/app/src/main/java/com/money/manager/ex/currency/CurrencyService.java index 84001d365..55a253e2e 100644 --- a/app/src/main/java/com/money/manager/ex/currency/CurrencyService.java +++ b/app/src/main/java/com/money/manager/ex/currency/CurrencyService.java @@ -21,6 +21,7 @@ import android.text.TextUtils; import android.util.Log; import android.util.LongSparseArray; +import android.widget.Toast; import com.money.manager.ex.Constants; import com.money.manager.ex.MmexApplication; @@ -493,6 +494,10 @@ public void updateExchangeRates(List currencies){ String symbol; String baseCurrencySymbol = getBaseCurrencyCode(); + if (baseCurrencySymbol == null ) { + Toast.makeText(getContext(),R.string.missing_default_currency,Toast.LENGTH_LONG).show(); + return; + } ArrayList currencySymbols = new ArrayList<>(); for (Currency currency : currencies) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e456d0bf3..8d6e28490 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -149,6 +149,7 @@ Conversion Currency name is required New/Edit Currency + Missing Default Currency in setting Amount From 2e66e8eb9b34f9b794a785024f7ab42f2fb3b0b4 Mon Sep 17 00:00:00 2001 From: "Emmanuele (WolfSolver)" Date: Wed, 27 Nov 2024 13:06:19 +0100 Subject: [PATCH 2/2] honor db readable reported by gPlay --- .../manager/ex/settings/DatabaseSettingsFragment.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/money/manager/ex/settings/DatabaseSettingsFragment.java b/app/src/main/java/com/money/manager/ex/settings/DatabaseSettingsFragment.java index a11a4223d..2a3fe5a88 100644 --- a/app/src/main/java/com/money/manager/ex/settings/DatabaseSettingsFragment.java +++ b/app/src/main/java/com/money/manager/ex/settings/DatabaseSettingsFragment.java @@ -128,8 +128,12 @@ private void refreshDbVersion() { final Preference preference = findPreference(requireActivity().getString(R.string.pref_database_version)); String version = "N/A"; - - SupportSQLiteDatabase db = openHelper.get().getReadableDatabase(); + SupportSQLiteDatabase db = null; + try { + db = openHelper.get().getReadableDatabase(); + } catch (Exception e) { + Timber.e(e); + } if (db != null) { int versionNumber = db.getVersion(); version = Integer.toString(versionNumber);