Skip to content

Commit

Permalink
Fix NPE and Bump Core Version (#453)
Browse files Browse the repository at this point in the history
* Fix NPE when listener is null

* Bump core version and update changelog
  • Loading branch information
sarahkoop committed Jan 4, 2024
1 parent 731a6a0 commit 6be2b86
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## unreleased

* Bump brinatree_android module dependency versions to `4.39.0`
* Bump braintree_android module dependency versions to `4.40.1`
* Fix NPE when `DropInListener` is null

## 6.13.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ private void getPaymentMethodNonces(final FetchMostRecentPaymentMethodCallback c
}

void onDropInResult(DropInResult dropInResult) {
if (dropInResult != null) {
if (dropInResult != null && listener != null) {
Exception error = dropInResult.getError();
if (error != null) {
listener.onDropInFailure(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,16 @@ public void onDropInResult_whenResultIsNull_doesNothing() {
verifyNoInteractions(listener);
}

@Test
public void onDropInResult_whenListenerIsNull_doesNothing() {
DropInClientParams params = new DropInClientParams();
DropInClient sut = new DropInClient(params);


DropInResult dropInResult = new DropInResult();
sut.onDropInResult(dropInResult);
}

@Test
public void invalidateClientToken_forwardsInvocationIntoBraintreeClient() {
BraintreeClient braintreeClient = new MockBraintreeClientBuilder().build();
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
}
}

ext.brainTreeVersion = "4.39.0"
ext.brainTreeVersion = "4.40.1"

ext.deps = [
"braintreeCore" : "com.braintreepayments.api:braintree-core:$brainTreeVersion",
Expand Down

0 comments on commit 6be2b86

Please sign in to comment.