summaryrefslogtreecommitdiffstats
path: root/src/BookContent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/BookContent.cpp')
-rw-r--r--src/BookContent.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/BookContent.cpp b/src/BookContent.cpp
index 4163d77d1..40819316b 100644
--- a/src/BookContent.cpp
+++ b/src/BookContent.cpp
@@ -80,8 +80,16 @@ void cBookContent::WriteToNBTCompound(const cBookContent & a_BookContent, cFastN
return;
}
- a_Writer.AddString("author", a_BookContent.GetAuthor());
- a_Writer.AddString("title", a_BookContent.GetTitle());
+ if (!a_BookContent.GetAuthor().empty())
+ {
+ a_Writer.AddString("author", a_BookContent.GetAuthor());
+
+ }
+ if (!a_BookContent.GetTitle().empty())
+ {
+ a_Writer.AddString("title", a_BookContent.GetTitle());
+
+ }
a_Writer.BeginList("pages", TAG_String);
for (const auto & Page : a_BookContent.GetPages())
{