-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Conversation
tree_item_inspected
causing Index p_column = 0 is out of bounds (cells.size() = 0).
tree_item_inspected
causing Index p_column = 0 is out of bounds (cells.size() = 0).
error message
editor/scene_tree_dock.cpp
Outdated
@@ -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); |
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.
I'm not familiar with this code but shouldn't this also be set to nullptr
to match the _input
case?
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.
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 ?
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.
I will move this a bit lower in the code instead, that way it will be clearer when it get set/reset
4d2cb3c
to
9eacbf6
Compare
CC @anniryynanen in case you can still reproduce the issue reliably, to confirm whether this fixes it. |
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.
Tested, I confirm this fixes the error and the crash.
Thanks! |
May fix #93565 but not 100% sure because I don't know how to reproduce reliably yet.