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

Admin purge command error #2500

Closed
tastybento opened this issue Sep 13, 2024 · 1 comment
Closed

Admin purge command error #2500

tastybento opened this issue Sep 13, 2024 · 1 comment
Assignees
Labels

Comments

@tastybento
Copy link
Member

Expected behavior

Command works

Observed/Actual behavior

Get an NPE:

[17:04:56 ERROR]: Command exception: /bsb purge 1
java.lang.NullPointerException: Cannot invoke "org.bukkit.World.equals(Object)" because the return value of "world.bentobox.bentobox.database.objects.Island.getWorld()" is null
	at BentoBox-2.5.4-SNAPSHOT-LOCAL.jar/world.bentobox.bentobox.api.commands.admin.purge.AdminPurgeCommand.lambda$getOldIslands$3(AdminPurgeCommand.java:136) ~[BentoBox-2.5.4-SNAPSHOT-LOCAL.jar:?]
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
	at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722) ~[?:?]
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
	at BentoBox-2.5.4-SNAPSHOT-LOCAL.jar/world.bentobox.bentobox.api.commands.admin.purge.AdminPurgeCommand.getOldIslands(AdminPurgeCommand.java:140) ~[BentoBox-2.5.4-SNAPSHOT-LOCAL.jar:?]
	at BentoBox-2.5.4-SNAPSHOT-LOCAL.jar/world.bentobox.bentobox.api.commands.admin.purge.AdminPurgeCommand.execute(AdminPurgeCommand.java:78) ~[BentoBox-2.5.4-SNAPSHOT-LOCAL.jar:?]
	at BentoBox-2.5.4-SNAPSHOT-LOCAL.jar/world.bentobox.bentobox.api.commands.CompositeCommand.call(CompositeCommand.java:292) ~[BentoBox-2.5.4-SNAPSHOT-LOCAL.jar:?]
	at BentoBox-2.5.4-SNAPSHOT-LOCAL.jar/world.bentobox.bentobox.api.commands.CompositeCommand.execute(CompositeCommand.java:260) ~[BentoBox-2.5.4-SNAPSHOT-LOCAL.jar:?]
	at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:91) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.3.10.jar:?]
	at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:31) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:19) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.commands.execution.CommandQueueEntry.execute(CommandQueueEntry.java:5) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:103) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:443) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.commands.Commands.performCommand(Commands.java:350) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.commands.Commands.performCommand(Commands.java:337) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.commands.Commands.performCommand(Commands.java:332) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.performUnsignedChatCommand(ServerGamePacketListenerImpl.java:2218) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$11(ServerGamePacketListenerImpl.java:2192) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1537) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:201) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1514) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1507) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.server.MinecraftServer.managedBlock(MinecraftServer.java:1466) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1473) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1318) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:330) ~[paper-1.21.1.jar:1.21.1-74-971a7a5]
	at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

Steps/models to reproduce

Run latest BentoBox version

BentoBox version


Plugin list

No response

Other

No response

@tastybento tastybento self-assigned this Sep 13, 2024
@tastybento tastybento added the Status: In progress Working on the issue. label Sep 13, 2024
tastybento added a commit that referenced this issue Sep 13, 2024
…error

Prevent null island worlds from blocking purging. #2500
@tastybento
Copy link
Member Author

This was caused by there being islands in the database for worlds that were not loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant