You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the asset server, try to load a file with an extension that does not match a loader.
Then, use asset_server.get_load_state and it returns LoadState::NotLoaded instead of LoadState::Failed
What you expected to happen
I would expect this to return LoadState::Failed
What actually happened
it returns LoadState::NotLoaded
Additional information
If we plan to address this bug, this requires inserting a SourceInfo struct for each asset that attempts to get loaded.
The reason the behavior exists as is, is because AssetServer::load_async immediately returns if there is no associated loaded for an asset's extension.
The text was updated successfully, but these errors were encountered:
NathanSWard
changed the title
AssetServer returns LoadState::NotLoaded when trying to load an assets with an invalid extension.
AssetServer returns LoadState::NotLoaded when trying to load an asset with an invalid extension.
May 27, 2021
…ngine#2318)
# Objective
- Currently, when calling any of the `AssetServer`'s `load` functions, if the extension does not exist for the given path, the returned handle's load state is always `LoadState::NotLoaded`.
- This is due to the `load_async` function early returning without properly creating a `SourceInfo` for the requested asset.
- Fixesbevyengine#2261
## Solution
- Add the `SourceInfo` prior to checking for valid extension loaders. And set the `LoadState` to `Failed` if the according loader does not exist.
Bevy version
main
What you did
Using the asset server, try to load a file with an extension that does not match a loader.
Then, use
asset_server.get_load_state
and it returnsLoadState::NotLoaded
instead ofLoadState::Failed
What you expected to happen
I would expect this to return
LoadState::Failed
What actually happened
it returns
LoadState::NotLoaded
Additional information
If we plan to address this bug, this requires inserting a
SourceInfo
struct for each asset that attempts to get loaded.The reason the behavior exists as is, is because
AssetServer::load_async
immediately returns if there is no associated loaded for an asset's extension.The text was updated successfully, but these errors were encountered: