Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stability: fix some dump reported by GPlay #1928

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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