Skip to content

Commit

Permalink
catch occasional crash on spawned gltf not found
Browse files Browse the repository at this point in the history
  • Loading branch information
robtfm committed Oct 15, 2024
1 parent 91a09d3 commit bf46600
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/scene_runner/src/update_world/gltf_container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,13 @@ fn update_ready_gltfs(
}
let instance = loaded.0.as_ref().unwrap();
if scene_spawner.instance_is_ready(*instance) {
let gltf = gltfs.get(h_gltf).unwrap();
let Some(gltf) = gltfs.get(h_gltf) else {
commands
.entity(bevy_scene_entity)
.try_insert(GltfProcessed::default());
error!("gltf was unloaded mysteriously. this shouldn't happen and things will be broken as a result.");
continue;
};

// let graph = _node_graph(&_debug_query, bevy_scene_entity);
// println!("{bevy_scene_entity:?}");
Expand Down

0 comments on commit bf46600

Please sign in to comment.