Skip to content

Commit

Permalink
Android: add missing null check in fiatToSatoshis (closes #2134)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsmith committed Jan 24, 2021
1 parent c85765a commit 90851a9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fun fiatToSatoshis(s: String): Long? {
if (!fiatEnabled()) return null
try {
// toDouble accepts only the English number format: see comment in Util.kt.
return fx.callAttr("fiat_to_amount", s.toDouble()).toLong()
return fx.callAttr("fiat_to_amount", s.toDouble())?.toLong()
} catch (e: NumberFormatException) {
throw ToastException(R.string.Invalid_amount)
}
Expand Down

0 comments on commit 90851a9

Please sign in to comment.