Skip to content

Commit

Permalink
fixed potential crash when undoing asset instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed May 30, 2024
1 parent 3342d4d commit 312c6c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion editor/src/world/graph/selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::fyrox::{
};
use crate::scene::SelectionContainer;
use crate::utils;
use fyrox::graph::BaseSceneGraph;

#[derive(Debug, Default, Clone, Eq)]
pub struct GraphSelection {
Expand Down Expand Up @@ -99,7 +100,11 @@ impl GraphSelection {
graph: &Graph,
) -> Option<(UnitQuaternion<f32>, Vector3<f32>)> {
if self.is_single_selection() {
Some(graph.global_rotation_position_no_scale(self.nodes[0]))
if graph.is_valid_handle(self.nodes[0]) {
Some(graph.global_rotation_position_no_scale(self.nodes[0]))
} else {
None
}
} else if self.is_empty() {
None
} else {
Expand Down

0 comments on commit 312c6c4

Please sign in to comment.