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

Fix crash when refreshing new character menu while the filtered list is empty #39400

Merged
merged 1 commit into from
Apr 9, 2020

Conversation

Qrox
Copy link
Contributor

@Qrox Qrox commented Apr 9, 2020

Summary

SUMMARY: Bugfixes "Fix crash when refreshing new character menu while the filtered list is empty"

Purpose of change

When filtering the profession or scenario list in new character menu, if no match is found, a "no result" popup will show up. While an indexing error would not happen before migrating the menu to ui_adaptor, after migration it's possible to trigger redraw of the menu when the list is empty, for example while the "no result" popup is being displayed, and cause an index-out-of-bounds error.

Describe the solution

Do not display profession or scenario data when the selected index is out of bounds.

Testing

Filtered profession / scenario lists in new character menu, and resized the game window when the "no result" popup showed up. Profession and scenario data were not redrawn. This should fix the crash, but I cannot test it because my build didn't crash before the fix either.

@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` Info / User Interface Game - player communication, menus, etc. labels Apr 9, 2020
@ZhilkinSerg ZhilkinSerg merged commit b9ccb4c into CleverRaven:master Apr 9, 2020
@Qrox Qrox deleted the fix-new-char-crash branch April 9, 2020 16:08
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` Info / User Interface Game - player communication, menus, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants