Fix crash importing a character with a minion main skill#2244
Draft
xh-forge wants to merge 3 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
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 attempts to populate a list of available minion skills in the dropdown interface. However, some minion instances don't have their
activeSkillListinitialized immediately upon import. This resulted in an unrecoverableipairs(nil)exception atBuild.lua:2044, crashing the application.Fixes #2243
Solution
I have added a defensive
ifcheck around the iteration block insrc/Modules/Build.lua. The code now verifies thatactiveSkill.minion.activeSkillListexists and contains at least one element (activeSkill.minion.activeSkillList[1]) before attempting to loop over the skills and populate the UI components.If the condition is not met, the dropdown simply stays unpopulated, effectively circumventing the crash without breaking the regular minion skill flow.
Testing
bustedtest suite natively, and it passed with 48 successes / 0 failures. The tests now include dedicated checks for missing/emptyactiveSkillListparameters.Checklist