[Solved] Error on command?

Hey, I just started coding with Sponge, and I got this error when I’m using my command:
[18:43:20] [Server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_151]
at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_151]
at net.minecraft.util.Util.func_181617_a(SourceFile:47) [h.class:?]
at org.spongepowered.common.SpongeImplHooks.onUtilRunTask(SpongeImplHooks.java:274) [SpongeImplHooks.class:1.12.2-2555-7.1.0-BETA-2837]
at net.minecraft.server.MinecraftServer.redirect$onRun$zja000(MinecraftServer.java:4007) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:721) [MinecraftServer.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:396) [nz.class:?]
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:666) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:524) [MinecraftServer.class:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_151]
Caused by: java.lang.NullPointerException
at net.minecraft.command.ServerCommandManager.func_71556_a(SourceFile:1084) ~[dh.class:?]
at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:958) ~[pa.class:?]
at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:937) ~[pa.class:?]
at net.minecraft.network.play.client.CPacketChatMessage.func_148833_a(SourceFile:37) ~[la.class:?]
at net.minecraft.network.play.client.CPacketChatMessage.func_148833_a(SourceFile:9) ~[la.class:?]
at org.spongepowered.common.network.PacketUtil.onProcessPacket(PacketUtil.java:149) ~[PacketUtil.class:1.12.2-2555-7.1.0-BETA-2837]
at net.minecraft.network.PacketThreadUtil$1.redirect$onProcessPacket$zkl000(SourceFile:539) ~[hv$1.class:?]
at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) ~[hv$1.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_151]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_151]
at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?]
… 7 more

Here’s my command’s code :
@Override
public CommandResult execute(CommandSource commandSource, CommandContext commandContext) throws CommandException {
if(!commandContext.getOne(“args”).isPresent()){
commandSource.sendMessage(Text.of("§cUsage: /mod <on|off>"));
} else {
commandSource.sendMessage(Text.of(commandContext.getOne(“args”).get().toString()));
}
return null;
}

Thanks in advance

Should be pretty apparent.

java.lang.NullPointerException
// ...
return null;

Sponge uses Optionals instead of returning null, so if an element isn’t explicitly marked with @Nullable then null values are not allowed. Your IDE should also provide a notice for this.

I strongly suggest you look over the Sponge Docs for commands, as I don’t know what prompted you to return null instead. You’ll find how to return a CommandResult there and other useful information.

By the way, you shouldn’t be returning at all in an error condition. Instead, throw a CommandException.