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

Avoid unwrap() on invalid asset #344

Merged
merged 5 commits into from
Jun 22, 2024
Merged

Avoid unwrap() on invalid asset #344

merged 5 commits into from
Jun 22, 2024

Conversation

djeedai
Copy link
Owner

@djeedai djeedai commented Jun 22, 2024

Prevent extract_effects() from attempting to unwrap() on an invalid asset handle, which causes a panic. Instead, use filter_map() to ignore compiled effects with an invalid handle. Add a regression test (no extraction) and an integration example of an empty effect to ensure there's no panic.

Fixes #343

Prevent `extract_effects()` from attempting to `unwrap()` on an invalid asset
handle, which causes a panic. Instead, use `filter_map()` to ignore compiled
effects with an invalid handle. Add a regression test (no extraction) and an
integration example of an empty effect to ensure there's no panic.

Fixes #343
@djeedai djeedai added C - bug Something isn't working A - internal Internal change on a core system labels Jun 22, 2024
@djeedai djeedai merged commit e4e5d25 into main Jun 22, 2024
16 of 17 checks passed
@djeedai djeedai deleted the u/filter-invalid-asset branch June 22, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A - internal Internal change on a core system C - bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unnecessary unwrap that can cause panic.
1 participant