Merge pull request #69284 from gdixr/bugfix-69082
Prevent editor crash when deleting children of GraphNode
This commit is contained in:
commit
d759210f52
1 changed files with 37 additions and 29 deletions
|
@ -366,6 +366,7 @@ void GraphNode::_notification(int p_what) {
|
|||
close_rect = Rect2();
|
||||
}
|
||||
|
||||
if (get_child_count() > 0) {
|
||||
for (const KeyValue<int, Slot> &E : slot_info) {
|
||||
if (E.key < 0 || E.key >= cache_y.size()) {
|
||||
continue;
|
||||
|
@ -394,12 +395,19 @@ void GraphNode::_notification(int p_what) {
|
|||
// Draw slot stylebox.
|
||||
if (s.draw_stylebox) {
|
||||
Control *c = Object::cast_to<Control>(get_child(E.key));
|
||||
if (!c || !c->is_visible_in_tree()) {
|
||||
continue;
|
||||
}
|
||||
if (c->is_set_as_top_level()) {
|
||||
continue;
|
||||
}
|
||||
Rect2 c_rect = c->get_rect();
|
||||
c_rect.position.x = sb->get_margin(SIDE_LEFT);
|
||||
c_rect.size.width = w;
|
||||
draw_style_box(sb_slot, c_rect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (resizable) {
|
||||
draw_texture(resizer, get_size() - resizer->get_size(), resizer_color);
|
||||
|
|
Loading…
Reference in a new issue