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

NPE while entity riding boat #1906

Open
GoldenGamerLP opened this issue Jul 20, 2023 · 4 comments
Open

NPE while entity riding boat #1906

GoldenGamerLP opened this issue Jul 20, 2023 · 4 comments

Comments

@GoldenGamerLP
Copy link

Description:

So, when summoning a boat and adding an entity as a passenger (in my case a player) to the boat, and try to teleport it, it prints out an exception.

Exception:

java.lang.NullPointerException: Cannot invoke "net.minestom.server.entity.Entity.getEntityMeta()" because "vehicle" is null
	at net.minestom.server.listener.PlayerVehicleListener.boatSteerListener(PlayerVehicleListener.java:39)
	at net.minestom.server.listener.manager.PacketListenerManager.processClientPacket(PacketListenerManager.java:90)
	at net.minestom.server.entity.Player.lambda$interpretPacketQueue$18(Player.java:1857)
	at org.jctools.queues.MpscUnboundedXaddArrayQueue.drain(MpscUnboundedXaddArrayQueue.java:312)
	at net.minestom.server.entity.Player.interpretPacketQueue(Player.java:1857)
	at net.minestom.server.entity.Player.update(Player.java:374)
	at net.minestom.server.entity.Entity.tick(Entity.java:543)
	at net.minestom.server.thread.TickThread.tick(TickThread.java:74)
	at net.minestom.server.thread.TickThread.run(TickThread.java:49)

Version:

@MasterBroNetwork
Copy link

MasterBroNetwork commented Jul 20, 2023

Have you changed anything in Minestom's code?
Line 39 is a comment when checking the GitHub.
Edit: I am not experienced with Minestom nor have I contributed any changes yet so please take anything that I say with a grain of salt.

@TheMeinerLP
Copy link
Contributor

TheMeinerLP commented Aug 11, 2023

@GoldenGamerLP There is a missing null check inside of the code.
Ref: https://github.com/Minestom/Minestom/blob/master/src/main/java/net/minestom/server/listener/PlayerVehicleListener.java#L41

Sorry i was wrong. I think you used a old version of it maybe.

@MelonHell
Copy link
Contributor

This has been fixed in 80f5db3

Judging by the stacktrace, such an exception simply cannot happen after this fix. I think the author used an older version than he indicated and this issue can be closed

@36479756
Copy link

36479756 commented Mar 26, 2024

This has been fixed in 80f5db3

Judging by the stacktrace, such an exception simply cannot happen after this fix. I think the author used an older version than he indicated and this issue can be closed

ok

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

No branches or pull requests

5 participants