Skip to content

Commit

Permalink
Initialize PayPalAccountNonce Values into Empty Strings Instead of `n…
Browse files Browse the repository at this point in the history
…ull` (#1028)

* Replace initial null values with empty strings in PayPalAccountNonce parse method.

* Replace initial null values with empty strings in PayPalNativeCheckoutAccountNonce parse method.

* Update CHANGELOG.
  • Loading branch information
sshropshire authored Jun 7, 2024
1 parent 7c950a2 commit 889fd77
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Braintree Android SDK Release Notes

## unreleased

* PayPal
* Fix `PayPalAccountNonce` Null Pointer Exception by ensuring that all `@NonNull` values are initialized with a non-null value.
* PayPalNativeCheckout
* Fix `PayPalNativeCheckoutAccountNonce` Null Pointer Exception by ensuring that all `@NonNull` values are initialized with a non-null value.

## 4.47.0 (2024-06-06)

* BraintreeCore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ static PayPalAccountNonce fromJSON(JSONObject inputJson) throws JSONException {
PayPalCreditFinancing payPalCreditFinancing = null;
PostalAddress shippingAddress;
PostalAddress billingAddress;
String firstName = null;
String lastName = null;
String phone = null;
String payerId = null;
String firstName = "";
String lastName = "";
String phone = "";
String payerId = "";
try {
if (details.has(CREDIT_FINANCING_KEY)) {
JSONObject creditFinancing = details.getJSONObject(CREDIT_FINANCING_KEY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ static PayPalNativeCheckoutAccountNonce fromJSON(JSONObject inputJson) throws JS
PayPalNativeCheckoutCreditFinancing payPalCreditFinancing = null;
PostalAddress shippingAddress;
PostalAddress billingAddress;
String firstName = null;
String lastName = null;
String phone = null;
String payerId = null;
String firstName = "";
String lastName = "";
String phone = "";
String payerId = "";
try {
if (details.has(CREDIT_FINANCING_KEY)) {
JSONObject creditFinancing = details.getJSONObject(CREDIT_FINANCING_KEY);
Expand Down

0 comments on commit 889fd77

Please sign in to comment.