diff --git a/examples/2d/texture_atlas.rs b/examples/2d/texture_atlas.rs index fca6eb5550..be41577cc5 100644 --- a/examples/2d/texture_atlas.rs +++ b/examples/2d/texture_atlas.rs @@ -51,7 +51,11 @@ fn setup( let mut texture_atlas_builder = TextureAtlasBuilder::default(); for handle in &rpg_sprite_handles.handles { let handle = handle.typed_weak(); - let texture = textures.get(&handle).expect("Textures folder contained a file which way matched by a loader which did not create an `Image` asset"); + let Some(texture) = textures.get(&handle) else { + warn!("{:?} did not resolve to an `Image` asset.", asset_server.get_handle_path(handle)); + continue; + }; + texture_atlas_builder.add_texture(handle, texture); }