Path: blob/main/_release-content/migration-guides/deprecate_asset_id_invalid.md
30632 views
------AssetId::invalid() and AssetId::INVALID_UUID have been deprecated. This is part of an effort to reduce special cases and optimize asset lookups.
If you were using AssetId::invalid() as a null value, the recommended solution is to change your variable to be Option<AssetId> and use None instead of AssetId::invalid().
Before:
After:
In some cases it may be possible to use AssetId::default() instead. But note that the default ID is not guaranteed to be a null value - an asset can be registered with the default ID.