fix null issue
All checks were successful
github-mirror / push-github (push) Successful in 3s
Build / Gradle-Build (push) Successful in 12s
Test / Gradle-Test (push) Successful in 16s

This commit is contained in:
Tueem 2024-12-03 20:20:57 +01:00
parent 29bb7e667e
commit bef34ee548

@ -16,9 +16,18 @@ public record ExecutableSlashCommandDefinition(
if (!(o instanceof ExecutableSlashCommandDefinition)) if (!(o instanceof ExecutableSlashCommandDefinition))
return false; return false;
ExecutableSlashCommandDefinition other = (ExecutableSlashCommandDefinition) o; ExecutableSlashCommandDefinition other = (ExecutableSlashCommandDefinition) o;
return other.applicationCommand.name().equals(this.applicationCommand.name()) && boolean equals = false;
other.subCommandGroup.name().equals(this.subCommandGroup.name()) &&
other.subCommand.name().equals(this.subCommand.name()); if (this.applicationCommand() != null && other.subCommandGroup() != null)
equals = this.applicationCommand.name().equals(other.applicationCommand().name());
if (this.subCommandGroup() != null && other.subCommandGroup() != null)
equals = this.subCommandGroup().name().equals(other.subCommandGroup().name());
if (this.subCommand() != null && other.subCommand() != null)
equals = this.subCommand().name().equals(other.subCommand().name());
return equals;
} }
@Override @Override