Skip to content

Commit dda7556

Browse files
committed
fix: ensure TeleportationException is sent
1 parent c1b0ebe commit dda7556

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

common/src/main/java/net/william278/huskhomes/teleport/TeleportationException.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import net.william278.huskhomes.HuskHomes;
2424
import net.william278.huskhomes.user.CommandUser;
2525
import org.jetbrains.annotations.NotNull;
26+
import org.jetbrains.annotations.Nullable;
2627

2728
public class TeleportationException extends IllegalStateException {
2829

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

39-
public void displayMessage(@NotNull CommandUser user, @NotNull String... args) {
40+
public void displayMessage(@Nullable CommandUser user, @NotNull String... args) {
41+
if (user == null) {
42+
user = plugin.getConsole();
43+
}
4044
switch (type) {
4145
case TELEPORTER_NOT_FOUND -> plugin.getLocales()
4246
.getLocale("error_player_not_found", args)

0 commit comments

Comments
 (0)