fixed crash when attempting to bring a destroyed widget into view

This commit is contained in:
Dmitry Stepanov
2026-03-11 19:13:51 +03:00
parent e726b3e8ac
commit 0853d5aed6
+2 -2
View File
@@ -35,7 +35,7 @@ use crate::{
};
use crate::message::MessageData;
use fyrox_core::uuid_provider;
use fyrox_core::{ok_or_return, uuid_provider};
use fyrox_graph::constructor::{ConstructorProvider, GraphNodeConstructor};
use fyrox_graph::SceneGraph;
@@ -187,7 +187,7 @@ impl ScrollPanel {
let mut parent = handle;
let mut relative_position = Vector2::default();
while parent.is_some() && parent != self.handle {
let node = ui.node(parent);
let node = ok_or_return!(ui.try_get_node(parent));
relative_position += node.actual_local_position();
parent = node.parent();
}