From 467264f59f1b2770320c9d6f931a336cc088f564 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sat, 20 Feb 2021 18:03:13 +0100 Subject: [PATCH] ScreenSaver: Don't expand special tokens with an empty string (#7314) --- frontend/ui/screensaver.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/ui/screensaver.lua b/frontend/ui/screensaver.lua index 99548a7b7..c5bdc283b 100644 --- a/frontend/ui/screensaver.lua +++ b/frontend/ui/screensaver.lua @@ -521,9 +521,9 @@ function Screensaver:expandSpecial(message, fallback) currentpage = Math.round(percent * totalpages) percent = Math.round(percent * 100) if docinfo.data.doc_props then - title = docinfo.data.doc_props.title or title - authors = docinfo.data.doc_props.authors or authors - series = docinfo.data.doc_props.series or series + title = docinfo.data.doc_props.title and docinfo.data.doc_props.title ~= "" and docinfo.data.doc_props.title or title + authors = docinfo.data.doc_props.authors and docinfo.data.doc_props.authors ~= "" and docinfo.data.doc_props.authors or authors + series = docinfo.data.doc_props.series and docinfo.data.doc_props.series ~= "" and docinfo.data.doc_props.series or series end docinfo:close() elseif instance ~= nil and lfs.attributes(lastfile, "mode") == "file" then @@ -534,9 +534,9 @@ function Screensaver:expandSpecial(message, fallback) percent = Math.round((currentpage * 100) / totalpages) local props = doc:getProps() if props then - title = props.title or title - authors = props.authors or authors - series = props.series or series + title = props.title and props.title ~= "" and props.title or title + authors = props.authors and props.authors ~= "" and props.authors or authors + series = props.series and props.series ~= "" and props.series or series end doc:close() end