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 a crash with ImTui on a fresh CDDA install #72235

Merged

Conversation

katemonster33
Copy link
Contributor

Summary

Bugfixes "On a fresh install, ImTui crashes and burns on loading"

Purpose of change

cataimgui::client::client() calls color_loader::load which doesn't ensure that the config directory exists before trying to populate it with the color JSON. This was OK before because base_colors.json wasn't needed on ncurses builds, now we need it for ImTui though.

Describe the solution

call ensure_dir_exist() inside color_loader::load to make sure the config directory exists.

Describe alternatives you've considered

the crash in ImTui/ImGui is supposed to be caught by the debug dialog, but ui_manager::redraw_invalidated() calls into cataimgui::client::new_frame(), which blows up when the client has not been initialized. in other words, right now CDDA will just crash when a debug error is thrown during loading, which is a significant regression which we must deal with eventually.

Testing

deleted my config directory and loaded the game and observed the lack of a crash.

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Mar 7, 2024
@dseguin dseguin merged commit 67b1ae2 into CleverRaven:master Mar 8, 2024
22 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants