WorldEdit

WorldEdit

43M Downloads

Parsers in console throw exception if no world override

octylFractal opened this issue ยท 0 comments

commented

Versions
WorldEdit version: 7.1.0, master as of writing this issue
Platform version: Paper-354

Describe the bug / To Reproduce
If you have no world override in console and do /replace anything anything, you will get the following exception:

> /replace stone air
[12:53:50 INFO]: Please report this error: [See console]
[12:53:50 INFO]: java.lang.NullPointerException: null
[12:53:50 ERROR]: An unexpected error while handling a WorldEdit command
java.lang.NullPointerException: null
        at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770) ~[patched_1.15.2.jar:git-Paper-354]
        at com.sk89q.worldedit.function.mask.AbstractExtentMask.setExtent(AbstractExtentMask.java:57) ~[?:?]
        at com.sk89q.worldedit.function.mask.AbstractExtentMask.<init>(AbstractExtentMask.java:39) ~[?:?]
        at com.sk89q.worldedit.function.mask.BlockMask.<init>(BlockMask.java:54) ~[?:?]
        at com.sk89q.worldedit.extension.factory.parser.mask.BlocksMaskParser.parseFromInput(BlocksMaskParser.java:58) ~[?:?]
        at com.sk89q.worldedit.extension.factory.parser.mask.BlocksMaskParser.parseFromInput(BlocksMaskParser.java:37) ~[?:?]
        at com.sk89q.worldedit.extension.factory.MaskFactory.parseFromInput(MaskFactory.java:98) ~[?:?]
        at com.sk89q.worldedit.extension.factory.MaskFactory.parseFromInput(MaskFactory.java:54) ~[?:?]
        at com.sk89q.worldedit.command.argument.FactoryConverter.convert(FactoryConverter.java:127) ~[?:?]
        at org.enginehub.piston.impl.CommandParser.lambda$isAcceptedByTypeParsers$6(CommandParser.java:483) ~[?:?]
        at java.util.stream.MatchOps$1MatchSink.accept(Unknown Source) ~[?:1.8.0_251]
        at java.util.Spliterators$IteratorSpliterator.tryAdvance(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.MatchOps$MatchOp.evaluateSequential(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_251]
        at java.util.stream.ReferencePipeline.anyMatch(Unknown Source) ~[?:1.8.0_251]
        at org.enginehub.piston.impl.CommandParser.isAcceptedByTypeParsers(CommandParser.java:478) ~[?:?]
        at org.enginehub.piston.impl.CommandParser.parseRegularArgument(CommandParser.java:434) ~[?:?]
        at org.enginehub.piston.impl.CommandParser.parse(CommandParser.java:326) ~[?:?]
        at org.enginehub.piston.impl.CommandManagerImpl.parse(CommandManagerImpl.java:230) ~[?:?]
        at org.enginehub.piston.CommandManager.execute(CommandManager.java:155) ~[?:?]
        at com.sk89q.worldedit.extension.platform.PlatformCommandManager.handleCommand(PlatformCommandManager.java:486) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251]
        at com.sk89q.worldedit.util.eventbus.MethodEventHandler.dispatch(MethodEventHandler.java:58) ~[?:?]
        at com.sk89q.worldedit.util.eventbus.EventHandler.handleEvent(EventHandler.java:73) ~[?:?]
        at com.sk89q.worldedit.util.eventbus.EventBus.dispatch(EventBus.java:193) ~[?:?]
        at com.sk89q.worldedit.util.eventbus.EventBus.post(EventBus.java:181) ~[?:?]
        at com.sk89q.worldedit.bukkit.WorldEditPlugin.onCommand(WorldEditPlugin.java:348) ~[?:?]
        at com.sk89q.bukkit.util.DynamicPluginCommand.execute(DynamicPluginCommand.java:55) ~[?:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.15.2.jar:git-Paper-354]
        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:761) ~[patched_1.15.2.jar:git-Paper-354]
        at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchServerCommand(CraftServer.java:723) ~[patched_1.15.2.jar:git-Paper-354]
        at net.minecraft.server.v1_15_R1.DedicatedServer.handleCommandQueue(DedicatedServer.java:470) ~[patched_1.15.2.jar:git-Paper-354]
        at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:432) ~[patched_1.15.2.jar:git-Paper-354]
        at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1181) ~[patched_1.15.2.jar:git-Paper-354]
        at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:970) ~[patched_1.15.2.jar:git-Paper-354]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]

Expected behavior
A message like with /pos1 would occur, informing you that a world is needed, or more complexly -- just say there is no defined selection, and try to parse properly otherwise.