getOrNull

inline fun <T> getOrNull(path: String): T?

Returns a loaded asset of type T loaded from selected path or null if the asset is not loaded yet or was never scheduled for loading. Rethrows any exceptions encountered during asset loading.

T is the type of the asset. Must match the type requested during loading. path must match the asset path passed during loading.

This method might throw the following exceptions:

See also get and getAsync.


fun <T> getOrNull(descriptor: AssetDescriptor<T>): T?

Returns a loaded asset of type T described by descriptor or null if the asset is not loaded yet or was never scheduled for loading. Rethrows any exceptions encountered during asset loading.

T is the type of the asset. Must match the type requested during loading. descriptor contains the asset data. See getAssetDescriptor.

This method might throw the following exceptions:

See also get and getAsync.


fun <T> getOrNull(identifier: Identifier<T>): T?

Returns a loaded asset of type T identified by identifier or null if the asset is not loaded yet or was never scheduled for loading. Rethrows any exceptions encountered during asset loading.

T is the type of the asset. Must match the type requested during loading. identifier uniquely identifies a file by its path and type. See Identifier.

This method might throw the following exceptions:

See also get and getAsync.