Skip to content

Commit

Permalink
Merge pull request #1928 from wolfsolver/master
Browse files Browse the repository at this point in the history
Stability: fix some dump reported by GPlay
  • Loading branch information
guanlisheng authored Nov 27, 2024
2 parents 2577e81 + 2e66e8e commit 0c39afe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -493,6 +494,10 @@ public void updateExchangeRates(List<Currency> currencies){

String symbol;
String baseCurrencySymbol = getBaseCurrencyCode();
if (baseCurrencySymbol == null ) {
Toast.makeText(getContext(),R.string.missing_default_currency,Toast.LENGTH_LONG).show();
return;
}
ArrayList<String> currencySymbols = new ArrayList<>();

for (Currency currency : currencies) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
<string name="conversion_to_base_rate">Conversion</string>
<string name="currency_name_empty">Currency name is required</string>
<string name="new_edit_currency">New/Edit Currency</string>
<string name="missing_default_currency">Missing Default Currency in setting</string>

<!-- transaction -->
<string name="amount">Amount</string>
Expand Down

0 comments on commit 0c39afe

Please sign in to comment.