diff --git a/src/main/java/de/oliver/fancyholograms/commands/hologram/InsertAfterCMD.java b/src/main/java/de/oliver/fancyholograms/commands/hologram/InsertAfterCMD.java index a8145c3..7c70ea8 100644 --- a/src/main/java/de/oliver/fancyholograms/commands/hologram/InsertAfterCMD.java +++ b/src/main/java/de/oliver/fancyholograms/commands/hologram/InsertAfterCMD.java @@ -44,6 +44,12 @@ public boolean run(@NotNull CommandSender player, @Nullable Hologram hologram, @ for (int i = 4; i < args.length; i++) { text += args[i] + " "; } + + if (text.isEmpty()) { + MessageHelper.error(player, "You need to provide a text to insert"); + return true; + } + text = text.substring(0, text.length() - 1); final var lines = new ArrayList<>(textData.getText()); diff --git a/src/main/java/de/oliver/fancyholograms/commands/hologram/InsertBeforeCMD.java b/src/main/java/de/oliver/fancyholograms/commands/hologram/InsertBeforeCMD.java index 78f90b1..5fb5034 100644 --- a/src/main/java/de/oliver/fancyholograms/commands/hologram/InsertBeforeCMD.java +++ b/src/main/java/de/oliver/fancyholograms/commands/hologram/InsertBeforeCMD.java @@ -46,6 +46,12 @@ public boolean run(@NotNull CommandSender player, @Nullable Hologram hologram, @ for (int i = 4; i < args.length; i++) { text += args[i] + " "; } + + if (text.isEmpty()) { + MessageHelper.error(player, "You need to provide a text to insert"); + return true; + } + text = text.substring(0, text.length() - 1); final var lines = new ArrayList<>(textData.getText());