Fixes a crash with written/writable books.

The issue was with generating description message for written books without title or author.

Fixes #318
This commit is contained in:
BONNe 2023-04-24 15:01:56 +03:00
parent 01bd7b82bb
commit 550e348428
1 changed files with 2 additions and 2 deletions

View File

@ -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),