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/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); 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