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

View File

@ -868,8 +868,8 @@ public class Utils
final String metaReference = Constants.ITEM_STACKS + "meta."; final String metaReference = Constants.ITEM_STACKS + "meta.";
String meta = user.getTranslationOrNothing(metaReference + "book-meta", String meta = user.getTranslationOrNothing(metaReference + "book-meta",
"[title]", bookMeta.getTitle(), "[title]", bookMeta.hasTitle() ? bookMeta.getTitle() : "",
"[author]", bookMeta.getAuthor()); "[author]", bookMeta.hasAuthor() ? bookMeta.getAuthor() : "");
return user.getTranslationOrNothing(Constants.ITEM_STACKS + "generic", return user.getTranslationOrNothing(Constants.ITEM_STACKS + "generic",
"[type]", prettifyObject(itemType, user), "[type]", prettifyObject(itemType, user),