Skip to content

Commit

Permalink
Fix AssetRegistry#get to support string ids (#5461)
Browse files Browse the repository at this point in the history
  • Loading branch information
willeastcott committed Jul 5, 2023
1 parent 3c51472 commit c55ab20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/framework/asset/asset-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ class AssetRegistry extends EventHandler {
* const asset = app.assets.get(100);
*/
get(id) {
return this._idToAsset.get(id);
// Since some apps incorrectly pass the id as a string, force a conversion to a number
return this._idToAsset.get(Number(id));
}

/**
Expand Down

0 comments on commit c55ab20

Please sign in to comment.