Skip to content

Commit 342ae91

Browse files
authored
fix: [#266] add null checking and default value based on iOS since getCurrency can produce null (#278)
* fix: [#266] add null checking and default value based on iOS since getCurrency can produce null * chore: [#266] cleanup comment
1 parent aedf585 commit 342ae91

File tree

1 file changed

+4
-1
lines changed
  • app/src/main/java/com/breadwallet/tools/util

1 file changed

+4
-1
lines changed

app/src/main/java/com/breadwallet/tools/util/Utils.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,13 @@ else if (name == PartnerNames.PUSHERSTAGING) {
303303
/// Description: 1715876807
304304
public static long tieredOpsFee(Context app, long sendAmount) {
305305

306+
double doubleRate = 83.000;
306307
double sendAmountDouble = new Double(String.valueOf(sendAmount));
307308
String usIso = Currency.getInstance(new Locale("en", "US")).getCurrencyCode();
308309
CurrencyEntity currency = CurrencyDataSource.getInstance(app).getCurrencyByIso(usIso);
309-
double doubleRate = currency.rate;
310+
if (currency != null) {
311+
doubleRate = currency.rate;
312+
}
310313
double usdInLTC = sendAmountDouble * doubleRate / 100_000_000.0;
311314
usdInLTC = Math.floor(usdInLTC * 100) / 100;
312315

0 commit comments

Comments
 (0)