Prevent creating empty sidecar directories

pull/3011/head
poire-z 7 years ago committed by Frans de Jonge
parent 17656778b1
commit dffa2f2563

@ -59,6 +59,9 @@ function BookInfo:show(file, book_props)
-- book_props may be provided if caller already has them available
-- but it may lack 'pages', that we may get from sidecar file
if not book_props or not book_props.pages then
-- check there is actually a sidecar file before calling DocSettings:open()
-- that would create an empty sidecar directory
if DocSettings:hasSidecarFile(file) then
local doc_settings = DocSettings:open(file)
if doc_settings then
if not book_props then
@ -85,6 +88,7 @@ function BookInfo:show(file, book_props)
end
end
end
end
-- If still no book_props (book never opened or empty 'stats'), open the
-- document to get them

Loading…
Cancel
Save