Fix NullReferenceException loop in AdventurerPlateStep#10
Merged
redstrate merged 1 commit intoMay 1, 2026
Merged
Conversation
`Run()` is called every frame while the Adventurer Plate window is
open (NeedsUpdateEveryFrame returns true), but the very first frames
after the window opens (and apparently on some 7.5 sessions in
general) have either AgentCharaCard.Instance()->Data or its
PortraitTexture pointer still null. The current code dereferences
these unconditionally inside GetCurrentCharaViewImage and throws a
NullReferenceException, swallowed by Dalamud's per-event error
handler — the result is a flood of [ERR] log entries each frame and
the step potentially completing on a frame where the plate is only
partially populated.
[ERR] [Auracite] Exception in event handler IFramework::Update
System.NullReferenceException: Object reference not set to an instance of an object.
at Auracite.AdventurerPlateStep.GetCurrentCharaViewImage() in …/AdventurerPlateStep.cs:line 106
at Auracite.AdventurerPlateStep.Run() in …/AdventurerPlateStep.cs:line 36
Walk the AgentCharaCard.Instance()->Data->PortraitTexture->D3D11Texture2D
pointer chain step by step inside GetCurrentCharaViewImage, returning
Image? and bailing out at the first null link. In Run(), also check
storage and bail out when GetCurrentCharaViewImage returns null. The
next frame retries cleanly. Once the texture is ready the existing
happy-path runs unchanged and Completed fires exactly once.
969c826 to
6222ae4
Compare
redstrate
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
AdventurerPlateStep.NeedsUpdateEveryFrame()returns true soRun()is invoked every frame while the Adventurer Plate window is open. On the very first frames after the window opens (and apparently on some 7.5 sessions in general),AgentCharaCard.Instance()->Data->PortraitTextureor itsD3D11Texture2Dpointer can still be null, butGetCurrentCharaViewImagedereferences both unconditionally.The result is a tight loop of
System.NullReferenceExceptionthrown fromGetCurrentCharaViewImage, swallowed by Dalamud's per-eventPluginErrorHandler, and printed as[ERR]once per frame indalamud.log— the step also never reachesCompleted?.Invoke()until the texture happens to be ready.Change
AgentCharaCard.Instance()->Data->PortraitTexture->D3D11Texture2Dpointer chain step by step insideGetCurrentCharaViewImage, returningImage?and bailing out at the first null link.Run(), also checkstoragefor null and bail out whenGetCurrentCharaViewImagereturns null. The next frame retries.When the texture is ready the existing happy-path runs unchanged and
Completedfires exactly once. The error-spam indalamud.loggoes away on slow open.Testing
Built and tested live on a 7.5 client (FR, API 15). Opening the Adventurer Plate now produces no
[ERR]lines forAuraciteand the step advances cleanly to the next stage. Verified the export still produces validbase-plate.png,backing.png, etc. in the resulting archive.