-
Notifications
You must be signed in to change notification settings - Fork 237
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
Conversation
} | ||
|
||
private void deliverVenmoSuccess(VenmoAccountNonce venmoAccountNonce) { | ||
if (listener != null) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
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 👍
Summary of changes
VenmoClient
when listener is null by checking if listener exists before returning success or failure (does nothing on result without listener, but does not crash)Checklist
Authors