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 clear custom color on invalid tree_item_inspected causing Index p_column = 0 is out of bounds (cells.size() = 0). error message #93576

Merged

Conversation

AeioMuch
Copy link
Contributor

May fix #93565 but not 100% sure because I don't know how to reproduce reliably yet.

@AeioMuch AeioMuch requested a review from a team as a code owner June 24, 2024 21:46
@AeioMuch AeioMuch changed the title Fix clear custom color on invalid tree_item_inspected causing Index p_column = 0 is out of bounds (cells.size() = 0). Fix clear custom color on invalid tree_item_inspected causing Index p_column = 0 is out of bounds (cells.size() = 0). error message Jun 24, 2024
@YeldhamDev YeldhamDev added this to the 4.3 milestone Jun 24, 2024
@@ -77,7 +77,7 @@ void SceneTreeDock::_quick_open() {

void SceneTreeDock::_inspect_hovered_node() {
select_node_hovered_at_end_of_drag = true;
if (tree_item_inspected != nullptr) {
if (tree_item_inspected) {
tree_item_inspected->clear_custom_color(0);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not familiar with this code but shouldn't this also be set to nullptr to match the _input case?

Copy link
Contributor Author

@AeioMuch AeioMuch Jun 25, 2024

Choose a reason for hiding this comment

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

I was thinking that it did not matter there because it is only to clear the custom color of the previously inspected item if you inspect another one in the same drag operation and thus I was thinking that you can't really invalidate it while doing the drag, plus it get set to the new one just a bit lower in the method, so not too sure honestly. But at the same time it may be safer ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will move this a bit lower in the code instead, that way it will be clearer when it get set/reset

@AeioMuch AeioMuch force-pushed the fix_invalid_clear_custom_color branch from 4d2cb3c to 9eacbf6 Compare June 28, 2024 04:11
@akien-mga
Copy link
Member

CC @anniryynanen in case you can still reproduce the issue reliably, to confirm whether this fixes it.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Tested, I confirm this fixes the error and the crash.

@akien-mga akien-mga merged commit 279a607 into godotengine:master Jun 28, 2024
18 checks passed
@akien-mga
Copy link
Member

Thanks!

@AeioMuch AeioMuch deleted the fix_invalid_clear_custom_color branch June 28, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C++ error when clicking anywhere in the editor
3 participants