Skip to content

Commit d38ff03

Browse files
committed
fix(outputters): Don't attempt to create output if we error before processing even starts
1 parent bfd24b5 commit d38ff03

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

core/utilities/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ function utilities.error (message, isbug)
332332
utilities.warn(message, isbug)
333333
_skip_traceback_levels = 2
334334
io.stderr:flush()
335-
SILE.outputter:finish() -- Only really useful from the REPL but no harm in trying
335+
SILE.outputter:finish()
336336
SILE.scratch.caughterror = true
337337
error("", 2)
338338
end

outputters/libtexpdf.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,13 @@ end
6868
function outputter._endHook (_) end
6969

7070
function outputter:finish ()
71-
self:_ensureInit()
72-
pdf.endpage()
73-
self:runHooks("prefinish")
74-
pdf.finish()
75-
started = false
76-
lastkey = nil
71+
if started then
72+
pdf.endpage()
73+
self:runHooks("prefinish")
74+
pdf.finish()
75+
started = false
76+
lastkey = nil
77+
end
7778
end
7879

7980
function outputter.getCursor (_)

0 commit comments

Comments
 (0)