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

Protect against null intent extras. #2643

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ import com.salesforce.androidsdk.util.EventsObservable.EventType.AuthWebViewCrea
import com.salesforce.androidsdk.util.EventsObservable.EventType.LoginActivityCreateComplete
import com.salesforce.androidsdk.util.SalesforceSDKLogger.d
import com.salesforce.androidsdk.util.SalesforceSDKLogger.e
import com.salesforce.androidsdk.util.SalesforceSDKLogger.w
import com.salesforce.androidsdk.util.UriFragmentParser.parse
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers.IO
Expand Down Expand Up @@ -179,7 +180,11 @@ open class LoginActivity : AppCompatActivity(), OAuthWebviewHelperEvents {
// Determine login options for Salesforce Identity API UI Bridge front door URL use or choose defaults.
val loginOptions = when {
isUsingFrontDoorBridge -> salesforceSDKManager.loginOptions
else -> fromBundleWithSafeLoginUrl(intent.extras)
else -> fromBundleWithSafeLoginUrl(intent.extras ?:
SalesforceSDKManager.getInstance().loginOptions.asBundle().also {
w(TAG, "intent.extras was null, but should contain LoginOptions bundle.")
}
)
}

// Protect against screenshots
Expand Down