From 4efa26fe0e68319f56741496ec757b5ef65eee48 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 10 May 2021 00:09:28 +0200 Subject: [PATCH] Added null-check for lore --- .../LinkedBeaconTeleporterManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterManager.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterManager.java index 883428a..a45b944 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterManager.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/LinkedBeaconTeleporterManager.java @@ -152,9 +152,11 @@ public class LinkedBeaconTeleporterManager { String serialiseBeaconItem(String name, List lore){ // get name and remove control-chars String str = name.replace("\\", "\\\\"); - for (String loreLine : lore) { - // get lore-lines and remove control-chars - str += "\n"+ loreLine.replace("\\", "\\\\"); + if(lore != null){ + for (String loreLine : lore) { + // get lore-lines and remove control-chars + str += "\n"+ loreLine.replace("\\", "\\\\"); + } } return str;