Fix crash importing a character with a minion main skill#2244
Draft
xh-forge wants to merge 5 commits into
Draft
Conversation
Contributor
|
How did you test this without having access to the character import in that issue? From my previous testing with #2217, this doesn't fix it since the program will crash soon after due to the missing skill selection |
- Add nil guards for activeSkill.minion.activeSkillList at two sites in Calcs.lua (lines 469, 578) that would crash with ipairs(nil) during the same frame cycle as the Build.lua fix - Add end-to-end test using a real minion skill (Skeletal Sniper) through the full OnFrame pipeline to verify activeSkillList, mainSkill, and UI controls are properly populated
…uildingCommunity#2243) Reproduce the exact bug scenario: ImportItemsAndSkills with a minion skill gem, then ImportPassiveTreeAndJewels to trigger a full rebuild, then verify OnFrame completes without crashing and that the minion's activeSkillList and mainSkill are properly populated.
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
When importing a character that uses a minion main skill, PathOfBuilding-PoE2 can temporarily have a minion object before the selected/display minion skill state is fully rebuilt.
This caused two related crash paths:
RefreshSkillSelectControlsiteratedactiveSkill.minion.activeSkillListwhile it wasnil, causingipairs(nil)atBuild.lua:2044.activeSkill.minion.mainSkill; hovering the socket group then crashed inSkillsTab.lua:1335.Fixes #2243. Also covers the follow-up missing minion skill selection path reported from #2217.
Solution
src/Modules/Build.luauntilactiveSkill.minion.activeSkillListexists and has at least one entry.activeSkillListiterations insrc/Modules/Calcs.lua.src/Classes/SkillsTab.luauntilactiveSkill.minion.mainSkillexists.When minion skill data is not ready, the dependent dropdown/tooltip section is skipped instead of dereferencing a missing table/object.
Testing
KozzieCull:https://poe.ninja/poe2/profile/Kosmo2409-4451/runesofaldur/character/KozzieCullpathOfBuildingExportHeadlessWrapper.luaClasses/SkillsTab.lua:1335due to missingactiveSkill.minion.mainSkillbusted --lua=luajit --pattern=TestSkills_spec.lua --filter=tooltip: 1 success / 0 failures / 0 errorsbusted --lua=luajit --pattern=TestSkills_spec.lua: 50 successes / 0 failures / 0 errorsbusted --lua=luajit: 424 successes / 0 failures / 0 errorsgit diff --check: cleanChecklist