Skip to content

Commit

Permalink
fix: ensure TeleportationException is sent
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Aug 22, 2024
1 parent c1b0ebe commit dda7556
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import net.william278.huskhomes.HuskHomes;
import net.william278.huskhomes.user.CommandUser;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class TeleportationException extends IllegalStateException {

Expand All @@ -36,7 +37,10 @@ public TeleportationException(@NotNull Type cause, @NotNull HuskHomes plugin) {
this.plugin = plugin;
}

public void displayMessage(@NotNull CommandUser user, @NotNull String... args) {
public void displayMessage(@Nullable CommandUser user, @NotNull String... args) {
if (user == null) {
user = plugin.getConsole();
}
switch (type) {
case TELEPORTER_NOT_FOUND -> plugin.getLocales()
.getLocale("error_player_not_found", args)
Expand Down

0 comments on commit dda7556

Please sign in to comment.