Skip to content

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

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

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
Copy Markdown

@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
@Ak-dude
Copy link
Copy Markdown
Author

Ak-dude commented Apr 3, 2026

hello?

@Owen1212055
Copy link
Copy Markdown
Member

Thank you for your pull request!

However, we are not accepting pull requests that generally change random documentation. And your bug fix doesnt exactly make sense, connection is never set to null on disconnection.

In the future, we recommend you look at github issues for what may be appropriate to pull request. 😄

@Owen1212055 Owen1212055 closed this Apr 4, 2026
@github-project-automation github-project-automation bot moved this from Awaiting review to Closed in Paper PR Queue Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

2 participants