From ad84cd848a5d8510583467d94a7a1cdfbe66539e Mon Sep 17 00:00:00 2001 From: Chris Eager <79161849+eager-signal@users.noreply.github.com> Date: Mon, 11 Aug 2025 17:26:21 -0500 Subject: [PATCH] Fix potential `NullPointerException` in `StripeManager#createPaymentIntent` --- .../textsecuregcm/subscriptions/StripeManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/subscriptions/StripeManager.java b/service/src/main/java/org/whispersystems/textsecuregcm/subscriptions/StripeManager.java index 6d28dc05c..d98d1e450 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/subscriptions/StripeManager.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/subscriptions/StripeManager.java @@ -229,7 +229,7 @@ public class StripeManager implements CustomerAwareSubscriptionPaymentProcessor try { return stripeClient.paymentIntents().create(builder.build(), commonOptions()); } catch (StripeException e) { - final String errorCode = e.getCode().toLowerCase(Locale.ROOT); + final String errorCode = StringUtils.lowerCase(e.getCode(), Locale.ROOT); switch (errorCode) { case "amount_too_small","amount_too_large" -> throw ExceptionUtils.wrap(new SubscriptionException.InvalidAmount(errorCode));