Skip to content

Fix NPE in setHeldItemSlot and clarify empty catches in SimpleServiceManager#13711

Open
Ak-dude wants to merge 1 commit intoPaperMC:mainfrom
Ak-dude:fix/null-checks-and-empty-catches
Open

Fix NPE in setHeldItemSlot and clarify empty catches in SimpleServiceManager#13711
Ak-dude wants to merge 1 commit intoPaperMC:mainfrom
Ak-dude:fix/null-checks-and-empty-catches

Conversation

@Ak-dude
Copy link

@Ak-dude Ak-dude commented Mar 17, 2026

  • Add null checks for holder and connection in CraftInventoryPlayer#setHeldItemSlot, matching the existing pattern in setItem() to prevent NPE when called on a disconnecting player
  • Replace silent empty catch blocks in SimpleServicesManager with explanatory comments describing why NoSuchElementException is swallowed

Would love feedback!

@Ak-dude Ak-dude requested a review from a team as a code owner March 17, 2026 20:46
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Mar 17, 2026
…sManager

- Add null checks for holder and connection in CraftInventoryPlayer#setHeldItemSlot,
  matching the existing pattern in setItem() to prevent NPE when called on a
  disconnecting player
- Replace silent empty catch blocks in SimpleServicesManager with explanatory
  comments describing why NoSuchElementException is swallowed
@Ak-dude Ak-dude force-pushed the fix/null-checks-and-empty-catches branch from 0075df2 to 72cb766 Compare March 17, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

1 participant