Skip to content

Fix crash wehn opening some old builds#1925

Merged
LocalIdentity merged 2 commits into
PathOfBuildingCommunity:devfrom
unrealdreamz:fix/stale-jewel-socket-load
May 21, 2026
Merged

Fix crash wehn opening some old builds#1925
LocalIdentity merged 2 commits into
PathOfBuildingCommunity:devfrom
unrealdreamz:fix/stale-jewel-socket-load

Conversation

@unrealdreamz
Copy link
Copy Markdown
Contributor

Summary

Fixes #522.

  • ignore saved jewel socket entries whose itemId no longer exists in the build item list
  • make the intuitive-leap radius helper use the existing safe jewel lookup path before reading jewel fields
  • add a regression spec for stale socket IDs so malformed saved builds do not poison passive tree state

Root Cause

The issue attachment contains a <Socket nodeId="36044" itemId="13"/> entry, but the saved <Items> list has no <Item id="13">. PassiveSpec:Load still copied that stale ID into self.jewels, leaving later passive tree/radius/loadout code with a socket reference to a missing item.

One crash path was PassiveSpecClass:NodesInIntuitiveLeapLikeRadius, which read item.jewelRadiusIndex before proving that self.build.itemsTab.items[itemId] actually existed.

Fix

PassiveSpec:Load now keeps only socket IDs that resolve to an existing saved item. The radius helper also routes through GetJewel, preserving the invariant that jewel radius logic only sees real jewel items.

This does not invent replacement items or change valid sockets; it only drops stale references that cannot be loaded correctly.

Validation

  • gh pr list --repo PathOfBuildingCommunity/PathOfBuilding-PoE2 --state all --search "#522" ... found no active crash/socket fix PR; the only hit was unrelated merged PR Add support for Jarngreipr's Strength mod #1871.
  • Issue fixture check against Ice.Slammer.txt: items=18 sockets=5 stale=[(36044, 13)].
  • python + lupa syntax compile:
    • PASS lua compile src/Classes/PassiveSpec.lua
    • PASS lua compile spec/System/TestPassiveSpec_spec.lua
  • git diff --cached --check: passed.
  • git show --check --stat --oneline --no-renames HEAD: passed.

Local Busted/Docker execution was not available in this checkout: lua, luajit, busted, docker, docker-compose were not found on PATH.

Risk / Rollback

Low risk. The load path already treats zero socket item IDs as invalid/empty; this extends that same containment to non-existent positive item IDs. Rolling back restores the previous behavior of retaining stale socket references and risking nil indexing during tree/loadout processing.

@LocalIdentity LocalIdentity changed the title Ignore stale jewel socket item ids while loading builds Fix crash on opening some old builds May 21, 2026
@LocalIdentity LocalIdentity added the crash Causes PoB to crash and is High Priority label May 21, 2026
@LocalIdentity LocalIdentity changed the title Fix crash on opening some old builds Fix crash wehn opening some old builds May 21, 2026
@LocalIdentity LocalIdentity merged commit 77cc01c into PathOfBuildingCommunity:dev May 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crash Causes PoB to crash and is High Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on startup

2 participants