Skip to content

Resource tree: don't crash on a model with no IMC handle - #611

Merged
Ottermandias merged 1 commit into
xivdev:testingfrom
link-0402:fix-null-imc-resource-tree
Nov 12, 2026
Merged

Ottermandias merged 1 commit into
xivdev:testingfrom
link-0402:fix-null-imc-resource-tree

Conversation

@link-0402

Copy link
Copy Markdown
Contributor

While working on a custom plugin that can turn entities into props with custom IDs for animations, I ran into the following issue with Penumbra:

When a character has a weapon summoned on a body number the game doesn’t ship (for example a mod’s prop placed on a free body), that model has no IMC file, so its IMC handle is null. ResolveContext.ResolveImcData reads the handle’s data without checking it, so building the resource tree throws a NullReferenceException in ResourceHandle.GetDataSpan(). While that model is drawn, every resource tree call for the character fails, so PlayerSync and LightlessSync can’t build the player’s data.

The fix returns the default IMC entry for a null handle. That’s what ResolveImcData already does for a handle with no data, and CreateNodeFromImc already skips a null handle.

Tested in game on 1.7.2.1 with the fix applied: with such a prop out, GetGameObjectResourcePaths no longer throws and lists the prop’s files, and both sync plugins build the player’s data again.

A weapon summoned on a body the game doesn't ship has a null IMC handle,
so ResolveImcData threw a NullReferenceException and every resource tree
call for that character failed. Return the default entry for it, as for
an IMC handle with no data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Ottermandias
Ottermandias merged commit 9f9fe52 into xivdev:testing Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants