EllanJiang/GameFramework · error · GameFrameworkException
Name is invalid.
Error message
Name is invalid.
What it means
The FileSystem class nested in UpdatableVersionList validates the file-system name in its constructor, requiring a non-null string (note: unlike other checks, only null is rejected here, not empty). The name is the key for grouping resources into file systems in the update list. A null name would break resource-to-filesystem mapping, so it throws.
Solutions
- Pass a non-null name to the FileSystem constructor
- Regenerate the updatable version list
- Fix the deserialization code that yields null names
Example fix
// before new FileSystem(null, resourceIndexes); // after if (name == null) throw new ArgumentNullException(nameof(name)); new FileSystem(name, resourceIndexes);
Defensive patterns
Strategy: validation
Validate before calling
if (fileSystemName == null) { Log.Error("FileSystem entry missing name"); return; } Type guard
bool HasFileSystemName(string n) => n != null;
Try / catch
try { var fs = new FileSystem(name, indexes); } catch (GameFrameworkException ex) when (ex.Message == "Name is invalid.") { Log.Error(ex, "Invalid file system entry in version list"); } Prevention
- Reject null file-system names when building version lists
- Checksum and verify update version files before parsing
- Keep the packaging tool output format aligned with the runtime parser
When it happens
Trigger: Constructing UpdatableVersionList.FileSystem with a null name, or deserializing an updatable version list whose file-system entry lacks a name field.
Common situations: Corrupt or truncated update version file, packaging tool emitting a null file-system name, or a parser reading a null string from malformed binary data.
Related errors
- Name is invalid.
- Name is invalid.
- Deserialize updatable version list failure.
- Parse updatable version list exception
- Updatable version list
AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15).
Data as JSON: /api/errors/974fb860073a8f38.
Report an issue: GitHub.
Appendix: source
Thrown at GameFramework/Resource/UpdatableVersionList.FileSystem.cs:34
/// </summary>
[StructLayout(LayoutKind.Auto)]
public struct FileSystem
{
private static readonly int[] EmptyIntArray = new int[] { };
private readonly string m_Name;
private readonly int[] m_ResourceIndexes;
/// <summary>
/// 初始化文件系统的新实例。
/// </summary>
/// <param name="name">文件系统名称。</param>
/// <param name="resourceIndexes">文件系统包含的资源索引集合。</param>
public FileSystem(string name, int[] resourceIndexes)
{
if (name == null)
{
throw new GameFrameworkException("Name is invalid.");
}
m_Name = name;
m_ResourceIndexes = resourceIndexes ?? EmptyIntArray;
}
/// <summary>
/// 获取文件系统名称。
/// </summary>
public string Name
{
get
{
return m_Name;
}
}
/// <summary>View on GitHub (pinned to d0c010b051)