Skip to content

Commit

Permalink
Fixes a crash with written/writable books.
Browse files Browse the repository at this point in the history
The issue was with generating description message for written books without title or author.

Fixes #318
  • Loading branch information
BONNe committed Apr 24, 2023
1 parent 01bd7b8 commit 550e348
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/world/bentobox/challenges/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -868,8 +868,8 @@ public static String prettifyObject(ItemStack item, @Nullable BookMeta bookMeta,
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),
Expand Down

0 comments on commit 550e348

Please sign in to comment.