Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve any potential NullPointerException throws caused by Entity#getClosestPlayer() #603

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

BenCheung0422
Copy link
Member

@BenCheung0422 BenCheung0422 commented Jan 4, 2024

Resolves #602
A NullPointerException would be thrown as there are missing null handles.
This kind of potential bugs would be reduced by the time #512 is finished.

Known ways to reproduce:

  • Player dies when there is a spark exists (can be generated by AirWizard) (? to 2.2.0-dev4)
  • Player dies when Obsidian Knight is active. (Unchecked) (2.2.0-dev3 to 2.2.0-dev4)

This (or potential) NullPointerException is thrown with missing null handles.
@BenCheung0422 BenCheung0422 changed the title Resolve NPEs with Entity#getClosestPlayer() Resolve any potential NullPointerException throws caused by Entity#getClosestPlayer() Jan 4, 2024
Copy link
Member

@Litorom Litorom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t need to test this. I see it works because it adds more checks and should work as intended.

@Litorom Litorom merged commit 373ab37 into MinicraftPlus:main Jan 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When the Air Wizard kills you, the game throws NPE.
3 participants