Skip to content

Commit

Permalink
Task - Reduce country iso exception (#118)
Browse files Browse the repository at this point in the history
- reduce emissions of "java.lang.IllegalArgumentException: Unsupported ISO 3166 country: en"
  • Loading branch information
vsima authored and kcw-grunt committed Jan 30, 2023
1 parent 6d1928f commit ef51c29
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ private Set<CurrencyEntity> getCurrencies(Activity context) {
JSONArray arr = fetchRates(context);
updateFeePerKb(context);
if (arr != null) {
String selectedISO = BRSharedPrefs.getIso(context);
int length = arr.length();
for (int i = 0; i < length; i++) {
CurrencyEntity tmp = new CurrencyEntity();
Expand All @@ -71,7 +72,6 @@ private Set<CurrencyEntity> getCurrencies(Activity context) {
tmp.name = tmpObj.getString("code");
tmp.code = tmpObj.getString("code");
tmp.rate = (float) tmpObj.getDouble("n");
String selectedISO = BRSharedPrefs.getIso(context);
if (tmp.code.equalsIgnoreCase(selectedISO)) {
BRSharedPrefs.putIso(context, tmp.code);
BRSharedPrefs.putCurrencyListPosition(context, i - 1);
Expand Down

0 comments on commit ef51c29

Please sign in to comment.