File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,6 @@ impl AssetServer {
236
236
asset_path : AssetPath < ' _ > ,
237
237
force : bool ,
238
238
) -> Result < AssetPathId , AssetServerError > {
239
- let asset_loader = self . get_path_asset_loader ( asset_path. path ( ) ) ?;
240
239
let asset_path_id: AssetPathId = asset_path. get_id ( ) ;
241
240
242
241
// load metadata and update source info. this is done in a scope to ensure we release the
@@ -280,6 +279,15 @@ impl AssetServer {
280
279
source_info. load_state = LoadState :: Failed ;
281
280
} ;
282
281
282
+ // get the according asset loader
283
+ let asset_loader = match self . get_path_asset_loader ( asset_path. path ( ) ) {
284
+ Ok ( loader) => loader,
285
+ Err ( err) => {
286
+ set_asset_failed ( ) ;
287
+ return Err ( err) ;
288
+ }
289
+ } ;
290
+
283
291
// load the asset bytes
284
292
let bytes = match self . server . asset_io . load_path ( asset_path. path ( ) ) . await {
285
293
Ok ( bytes) => bytes,
@@ -708,7 +716,7 @@ mod test {
708
716
_ => false ,
709
717
} ) ;
710
718
711
- assert_eq ! ( asset_server. get_load_state( handle) , LoadState :: NotLoaded ) ;
719
+ assert_eq ! ( asset_server. get_load_state( handle) , LoadState :: Failed ) ;
712
720
}
713
721
714
722
#[ test]
You can’t perform that action at this time.
0 commit comments