Prevent crash when parsing an invalid custom donation amount.

This commit is contained in:
Greyson Parrelli
2026-06-11 14:22:37 +00:00
parent 45a3c44d0c
commit cd98fd894d
@@ -42,6 +42,7 @@ import org.whispersystems.signalservice.api.subscriptions.SubscriberId
import java.math.BigDecimal
import java.text.DecimalFormat
import java.text.DecimalFormatSymbols
import java.text.ParseException
import java.util.Currency
import java.util.Optional
@@ -170,6 +171,8 @@ class DonateToSignalViewModel(
decimalFormat.parse(amount) as BigDecimal
} catch (e: NumberFormatException) {
BigDecimal.ZERO
} catch (e: ParseException) {
BigDecimal.ZERO
}
}