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

Fix NPE caused by unset `productFlowPriority` #155

Merged
merged 2 commits into from Feb 8, 2019

Conversation

Projects
None yet
2 participants
@thepoofy
Copy link
Contributor

thepoofy commented Feb 7, 2019

Fixed #153
Verified by unit tests.

Description: Lack of an initial value caused a NPE when LoginManager#login(Activity) was invoked.

Related issue(s): #153

Fix NPE caused by unset `productFlowPriority`
Fixed #153
Verified by unit tests.

@thepoofy thepoofy requested a review from jck2 Feb 7, 2019

@jck2

jck2 approved these changes Feb 7, 2019

@@ -178,7 +179,7 @@ public void login(final @NonNull Activity activity) {
if (ssoDeeplink.isSupported(SsoDeeplink.FlowVersion.REDIRECT_TO_SDK)) {
Intent intent = LoginActivity.newIntent(
activity,
new ArrayList<>(productFlowPriority),
productFlowPriority,

This comment has been minimized.

@thepoofy

thepoofy Feb 7, 2019

Author Contributor

No longer necessary to wrap this in a new ArrayList since we are only storing defensive copy ArrayLists.

validateLoginIntentFields(resultIntent, supportedAppTypes, sessionConfiguration,
ResponseType.TOKEN, false, true, true);
assertThat(codeCaptor.getValue()).isEqualTo(REQUEST_CODE_LOGIN_DEFAULT);
}

This comment has been minimized.

@thepoofy

thepoofy Feb 7, 2019

Author Contributor

This test proved a NPE would be thrown by original code.

@jck2

This comment has been minimized.

Copy link
Contributor

jck2 commented Feb 7, 2019

Good catch!

@thepoofy thepoofy merged commit a1cfbdb into uber:master Feb 8, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment