From 550e348428228bb1b3e54e8d02c456b539c39738 Mon Sep 17 00:00:00 2001 From: BONNe Date: Mon, 24 Apr 2023 15:01:56 +0300 Subject: [PATCH] Fixes a crash with written/writable books. The issue was with generating description message for written books without title or author. Fixes #318 --- src/main/java/world/bentobox/challenges/utils/Utils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/world/bentobox/challenges/utils/Utils.java b/src/main/java/world/bentobox/challenges/utils/Utils.java index 5b7e2df..a42850d 100644 --- a/src/main/java/world/bentobox/challenges/utils/Utils.java +++ b/src/main/java/world/bentobox/challenges/utils/Utils.java @@ -868,8 +868,8 @@ public class Utils final String metaReference = Constants.ITEM_STACKS + "meta."; String meta = user.getTranslationOrNothing(metaReference + "book-meta", - "[title]", bookMeta.getTitle(), - "[author]", bookMeta.getAuthor()); + "[title]", bookMeta.hasTitle() ? bookMeta.getTitle() : "", + "[author]", bookMeta.hasAuthor() ? bookMeta.getAuthor() : ""); return user.getTranslationOrNothing(Constants.ITEM_STACKS + "generic", "[type]", prettifyObject(itemType, user),