Closed kmichalak closed 6 years ago
I have found that constructor of the class com.braintreegateway.UsBankAccount adds subscription objects to an uninitialized list
public UsBankAccount(NodeWrapper node) { this.routingNumber= node.findString("routing-number"); this.last4 = node.findString("last-4"); this.accountType = node.findString("account-type"); this.accountHolderName = node.findString("account-holder-name"); this.token = node.findString("token"); this.imageUrl = node.findString("image-url"); this.bankName = node.findString("bank-name"); for (NodeWrapper subscriptionResponse : node.findAll("subscriptions/subscription")) { // Here is the place where NullPointerException can be thrown this.subscriptions.add(new Subscription(subscriptionResponse)); } this.customerId = node.findString("customer-id"); this.isDefault = node.findBoolean("default"); this.achMandate = new AchMandate(node.findFirst("ach-mandate")); }
In other places, like CoinbaseAccount, a for-loop is proceded with list initialization like this
this.subscriptions = new ArrayList<Subscription>();
You are absolutely right @kmichalak ! We will add that fix right away. Good catch.
Hey @kmichalak ! The fix has been released in v2.77.0. Thank you so much for pointing that out. 🎆
General information
Possible NullPointerException during UsBankAccount instantiation
I have found that constructor of the class com.braintreegateway.UsBankAccount adds subscription objects to an uninitialized list
In other places, like CoinbaseAccount, a for-loop is proceded with list initialization like this