Fix NPE in classic commands

This commit is contained in:
FlorianMichael 2024-04-12 00:16:41 +02:00
parent d3bd33cbd0
commit 8f6ad8694d
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ public class ListExtensionsCommand extends VFPViaSubCommand {
@Override
public boolean execute(ViaCommandSender sender, String[] args) {
if (!getUser().has(ExtensionProtocolMetadataStorage.class)) {
if (getUser() == null || !getUser().has(ExtensionProtocolMetadataStorage.class)) {
sendMessage(sender, Formatting.RED + "Only for " + LegacyProtocolVersion.c0_30cpe.getName());
return true;
}

View File

@ -44,7 +44,7 @@ public class SetTimeCommand extends VFPViaSubCommand {
@Override
public boolean execute(ViaCommandSender sender, String[] args) {
if (!getUser().has(TimeLockStorage.class)) {
if (getUser() == null || !getUser().has(TimeLockStorage.class)) {
sendMessage(sender, Formatting.RED + "Only for <= " + LegacyProtocolVersion.a1_0_16toa1_0_16_2.getName());
return true;
}