Skip to content

fix: nil-safe aura/range iteration + pet spell-load caching (12.0)#1845

Open
mjodheim wants to merge 3 commits into
tukui-org:mainfrom
mjodheim:fix/12.0-secret-aura-iteration
Open

fix: nil-safe aura/range iteration + pet spell-load caching (12.0)#1845
mjodheim wants to merge 3 commits into
tukui-org:mainfrom
mjodheim:fix/12.0-secret-aura-iteration

Conversation

@mjodheim

@mjodheim mjodheim commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Defensive nil-guards and iteration safety for unit-frame aura/range code paths that can error in 12.0 (and generally). Split out from a larger bundle so each fix is reviewable on its own. Carries over the remaining fixes from #1830 rebased on current main.

UnitFrames/Elements/Range.lua

UpdateRangeList(db) can be called with a nil db, and UnitInSpellsRange reads list[which] which may be nil before the list is built — both then index/iterate nil. Return early.

ActionBars/PetBar.lua

Cache the loaded spellID per pet button and only (re)register the ContinueWithCancelOnSpellLoad callback when it actually changes, instead of on every UpdatePet. Avoids stacked callbacks and stale tooltipSubtext.

oUF_Plugins/oUF_AuraBars.lua, oUF_AuraWatch.lua, oUF_AuraHighlight.lua

AuraFiltered[filter][unit] can be nil (no auras of that filter yet) → next(nil) errors. Bail out early. For AuraBars/AuraWatch also snapshot the filtered set into a local array before iterating, so callbacks that mutate AuraFiltered mid-loop can't break next()'s traversal.

Notes

Supersedes the stale #1830 (which was ~157 commits behind main); companion to #1843 and #1844.

mjodheim and others added 3 commits June 6, 2026 18:59
UpdateRangeList(db) can be called with a nil db, and UnitInSpellsRange reads
list[which] which may be nil before the range list is built; both then index/
iterate nil and error. Return early in those cases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Cache the loaded spellID per pet button and cancel/replace the
ContinueWithCancelOnSpellLoad callback only when it actually changes, instead of
registering a new callback on every UpdatePet. Prevents stacked callbacks and
stale tooltipSubtext.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…aHighlight)

AuraFiltered[filter][unit] can be nil (no auras of that filter yet for the unit);
next(nil) then errors. Bail out early when it's nil. For AuraBars and AuraWatch
also snapshot the filtered set into a local array before iterating, so callbacks
that mutate AuraFiltered during the loop can't break next()'s traversal.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant