diff --git a/src/main/java/eu/decentsoftware/holograms/api/holograms/HologramLine.java b/src/main/java/eu/decentsoftware/holograms/api/holograms/HologramLine.java index 81ff3f9f..aa8d8b91 100644 --- a/src/main/java/eu/decentsoftware/holograms/api/holograms/HologramLine.java +++ b/src/main/java/eu/decentsoftware/holograms/api/holograms/HologramLine.java @@ -299,7 +299,7 @@ private String getText(@NonNull Player player, boolean update) { // Update cache if (update || string == null) { - string = text; + string = text == null ? "" : null; // Parse placeholders. if (!hasFlag(EnumFlag.DISABLE_PLACEHOLDERS)) { string = parsePlaceholders(string, player, containsPlaceholders); @@ -340,6 +340,12 @@ private String parsePlaceholders(@NonNull String string, @NonNull Player player, .replace("{pages}", String.valueOf(hasParent() ? parent.getParent().size() : 1)); if (papi) { string = PAPI.setPlaceholders(player, string); + if (string == null) { + // Some PlacehoderAPI placeholders might be replaced with null, so if the line content + // is just a single placeholder, there is a possibility that the line will be null. So, + // if that happens, just replace the null with an empty string. + string = ""; + } } return string; }