fix: nil-safe aura/range iteration + pet spell-load caching (12.0)#1845
Open
mjodheim wants to merge 3 commits into
Open
fix: nil-safe aura/range iteration + pet spell-load caching (12.0)#1845mjodheim wants to merge 3 commits into
mjodheim wants to merge 3 commits into
Conversation
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>
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.
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.luaUpdateRangeList(db)can be called with a nildb, andUnitInSpellsRangereadslist[which]which may be nil before the list is built — both then index/iterate nil. Return early.ActionBars/PetBar.luaCache the loaded
spellIDper pet button and only (re)register theContinueWithCancelOnSpellLoadcallback when it actually changes, instead of on everyUpdatePet. Avoids stacked callbacks and staletooltipSubtext.oUF_Plugins/oUF_AuraBars.lua,oUF_AuraWatch.lua,oUF_AuraHighlight.luaAuraFiltered[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 mutateAuraFilteredmid-loop can't breaknext()'s traversal.Notes
Supersedes the stale #1830 (which was ~157 commits behind
main); companion to #1843 and #1844.