EllanJiang/GameFramework · error · GameFrameworkException
Dependency assets is invalid.
Error message
Dependency assets is invalid.
What it means
Static AssetObject.Create validates that the dependencyAssets list argument is non-null before creating an asset object. A null list cannot represent 'no dependencies' — callers must pass an empty list instead. This is a fail-fast argument guard inside ResourceManager's resource loader.
Solutions
- Pass a non-null (possibly empty) List<object> for dependencyAssets.
- Fix your wrapper so it converts null to new List<object>() before calling the API.
- If dependencies are computed dynamically, initialize the list before any early-return path.
Example fix
// before m_ResourceManager.LoadAsset(assetName, typeof(GameObject), onLoad, null); // null dependency list // after m_ResourceManager.LoadAsset(assetName, typeof(GameObject), onLoad, new List<object>());
Defensive patterns
Strategy: validation
Validate before calling
if (dependencyAssets == null) dependencyAssets = new List<object>();
Type guard
bool HasDependencyList(List<object> deps) => deps != null;
Prevention
- Never pass null where an empty list is acceptable.
- Initialize dependency lists at declaration time.
- Wrap LoadAsset in a helper that normalizes null collections.
When it happens
Trigger: Calling ResourceManager.LoadAsset (or ResourceLoader.LoadAsset) with dependencyAssets == null, or custom loader code calling AssetObject.Create directly with a null list.
Common situations: Custom load pipelines that compute dependency lists conditionally and assign null when none exist instead of an empty List<object>; wrappers around LoadAsset forwarding a null parameter.
Related errors
- Resource is invalid.
- Resource helper is invalid.
- Resource loader is invalid.
- Resource name is invalid.
- Resource extension is invalid.
AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15).
Data as JSON: /api/errors/9dc15616ed752d51.
Report an issue: GitHub.
Appendix: source
Thrown at GameFramework/Resource/ResourceManager.ResourceLoader.AssetObject.cs:49
m_ResourceHelper = null;
m_ResourceLoader = null;
}
public override bool CustomCanReleaseFlag
{
get
{
int targetReferenceCount = 0;
m_ResourceLoader.m_AssetDependencyCount.TryGetValue(Target, out targetReferenceCount);
return base.CustomCanReleaseFlag && targetReferenceCount <= 0;
}
}
public static AssetObject Create(string name, object target, List<object> dependencyAssets, object resource, IResourceHelper resourceHelper, ResourceLoader resourceLoader)
{
if (dependencyAssets == null)
{
throw new GameFrameworkException("Dependency assets is invalid.");
}
if (resource == null)
{
throw new GameFrameworkException("Resource is invalid.");
}
if (resourceHelper == null)
{
throw new GameFrameworkException("Resource helper is invalid.");
}
if (resourceLoader == null)
{
throw new GameFrameworkException("Resource loader is invalid.");
}
AssetObject assetObject = ReferencePool.Acquire<AssetObject>();View on GitHub (pinned to d0c010b051)