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

Fixed Crash when butchering single animal. #33976

Merged
merged 1 commit into from
Sep 12, 2019

Conversation

hansonry
Copy link
Contributor

@hansonry hansonry commented Sep 12, 2019

Summary

SUMMARY: Bugfixes "Fixed Butchering related crash #32695"

Purpose of change

To fix the issue related to #32695. I also added checking in other locations where there may be an empty backlog.

Describe the solution

As I understand backlogs. They have a high chance of being empty at this point in time. If the backlog is empty comparing it with another action will result in a segmentation fault. My fix simply checks to see if the backlog is not empty. Then the check can be done safely.

Describe alternatives you've considered

I poked around the code and asked questions on the Discord. I spent a bit of time trying to figure out if the backlog being empty is common in these cases. This is my first time in the code so my confidence is low.

I tested using the attached save file before and after.
Boyne Falls.zip

@hansonry hansonry mentioned this pull request Sep 12, 2019
@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` labels Sep 12, 2019
@ghost
Copy link

ghost commented Sep 12, 2019

Yep this is what I should've done, apologies for messing this up.

@ghost ghost self-assigned this Sep 12, 2019
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! all seems fine.

@ZhilkinSerg ZhilkinSerg merged commit 17b8573 into CleverRaven:master Sep 12, 2019
@hansonry hansonry deleted the ButcheringCrashFix32695 branch September 12, 2019 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants