-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Prevent possible nullptr crash #56405
Conversation
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.
Just some minor whitespace changes so it is consistent with existing whitespace
Co-authored-by: NetSysFire <59517351+NetSysFire@users.noreply.github.com>
Co-authored-by: NetSysFire <59517351+NetSysFire@users.noreply.github.com>
I'm curious what it was about shoulder straps in particular that causes this to happen. Is it because shoulder straps aren't technically armor? We don't explicitly check for nullptr elsewhere in this method, so it might be worth tweaking it just to make the code fit in a little better. |
@Inglonias The call to |
Co-authored-by: NetSysFire <59517351+NetSysFire@users.noreply.github.com>
Summary
Bugfixes "Prevent possible nullptr crash"
Purpose of change
Fixes #56382
Fixes #56389
Describe the solution
A pointer that can be a nullptr was being referenced, causing a crash when viewing a shoulder strap mod or its recipe. This avoids the use of the pointer when nullptr - behaviour is the same as in other sections of code that use the same pointer.
Describe alternatives you've considered
Testing
Viewing the recipe or shoulder strap item causes no problems. Viewed all recipes with no crashes.
Additional context