Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app.world().is_resource_added::<T>() panics instead of returning false #2828

Closed
RustyStriker opened this issue Sep 15, 2021 · 1 comment
Closed
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior D-Good-First-Issue Nice and easy! A great choice to get started with Bevy

Comments

@RustyStriker
Copy link

Bevy version

0.5

Operating system & version

Arch(tho not relevant)

What you did

Calling app.world().is_resource_added::<T>() on a resource that wasn't added.

What you expected to happen

function to return false

What actually happened

It paniced

Additional information

Crashed at this line

bevy_ecs/src/world/mod.rs:574:79

because of the unwrap() at the end.

@RustyStriker RustyStriker added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Sep 15, 2021
@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events D-Good-First-Issue Nice and easy! A great choice to get started with Bevy and removed S-Needs-Triage This issue needs to be labelled labels Sep 15, 2021
@dixonwille
Copy link
Contributor

dixonwille added a commit to dixonwille/bevy that referenced this issue Sep 24, 2021
Changed out unwraps to use if let syntax instead. Returning false when None.

Also modified an existing test to encompass these methods

This PR fixes bevyengine#2828
@bors bors bot closed this as completed in d158e08 Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior D-Good-First-Issue Nice and easy! A great choice to get started with Bevy
Projects
None yet
3 participants