Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VenmoListener NPE Fix #848

Merged
merged 8 commits into from
Dec 11, 2023
Merged

VenmoListener NPE Fix #848

merged 8 commits into from
Dec 11, 2023

Conversation

sarahkoop
Copy link
Contributor

@sarahkoop sarahkoop commented Dec 11, 2023

Summary of changes

Checklist

  • Added a changelog entry

Authors

@sarahkoop sarahkoop requested a review from a team as a code owner December 11, 2023 16:37
}

private void deliverVenmoSuccess(VenmoAccountNonce venmoAccountNonce) {
if (listener != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to handle if the listener is null in either of these cases? Not sure of the best way to do that or even if that'd be helpful to a merchant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure there is any way to handle when the listener is null aside from just not crashing - without the listener we can't deliver a result, and updating the method to throw an error would be a breaking change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 is there any way for us to output something to the console? Mainly thinking for merchants who do something weird to have anything to point them potentially towards what they may have done wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added warning logs here if the listeners are null

@@ -33,6 +34,8 @@ public class VenmoClient {
static final String EXTRA_USERNAME = "com.braintreepayments.api.EXTRA_USER_NAME";
static final String EXTRA_RESOURCE_ID = "com.braintreepayments.api.EXTRA_RESOURCE_ID";

static final String LOGGING_TAG = "Braintree";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static final String LOGGING_TAG = "Braintree";
static final String LOGGING_TAG = "Braintree SDK";

nit: take or leave. Also I could see us moving this constant to a Core file one day.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update and moved to a LoggingUtils class 👍

@sarahkoop sarahkoop merged commit 2dbc07c into main Dec 11, 2023
3 checks passed
@sarahkoop sarahkoop deleted the venmo_npe_fix branch December 11, 2023 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash NPE on onVenmoFailure listener is null
3 participants