-
Notifications
You must be signed in to change notification settings - Fork 388
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
Added Null check to prevent crash for TrailHead Go Android #2633
base: dev
Are you sure you want to change the base?
Added Null check to prevent crash for TrailHead Go Android #2633
Conversation
Thanks for the contribution! It looks like @umashankar-sf is an internal user so signing the CLA is not required. However, we need to confirm this. |
Tests results for SalesforceSDKGenerated by 🚫 Danger |
Tests results for SmartStoreGenerated by 🚫 Danger |
Tests results for SalesforceHybridGenerated by 🚫 Danger |
Tests results for MobileSyncGenerated by 🚫 Danger |
Tests:
Tests results for SalesforceReactGenerated by 🚫 Danger |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #2633 +/- ##
============================================
- Coverage 58.93% 58.82% -0.12%
+ Complexity 2456 2450 -6
============================================
Files 189 189
Lines 15475 15477 +2
Branches 1998 2000 +2
============================================
- Hits 9120 9104 -16
- Misses 5426 5439 +13
- Partials 929 934 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
} | ||
|
||
fun getGlobalPrefs(): SharedPreferences { | ||
val ctx = SalesforceSDKManager.getInstance().appContext | ||
return ctx.getSharedPreferences(policyKey, Context.MODE_PRIVATE) | ||
} | ||
|
||
fun getPolicy(account: UserAccount): Policy { | ||
fun getPolicy(account: UserAccount?): Policy { |
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.
This is incorrect. There are two places where this is API is used and both check the account is not null first.
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 don't understand what scenario this change is for. When would the options
Bundle ever be null?
If you are launching the LoginActivity yourself (which I do not recommend) you need to supply the correct values so we can use them here.
com.salesforce.trailheadgo.app_issue_fa4327a6a3154091d49279fa5eba233c_crash_session_6722C99202280001286FF83BCF5223CF_DNE_0_v2_stacktrace.txt
https://console.firebase.google.com/project/trailhead-go/crashlytics/app/android:com.salesforce.trailheadgo.app/issues/3acb1308797bc3f5179c50ae5d9d0335?time=last-ninety-days&types=crash&versions=4.1.1%20(4)%20(4010101)&sessionEventKey=672B3B16020000015F77FD9E92962BED_2012546185538799571
https://console.firebase.google.com/project/trailhead-go/crashlytics/app/android:com.salesforce.trailheadgo.app/issues/fa4327a6a3154091d49279fa5eba233c?time=last-ninety-days&types=crash&versions=4.1.1%20(4)%20(4010101)