Skip to content

Commit 2a33065

Browse files
author
Mickael
committed
Add safeguards fo finish in pause.js #5461
1 parent 83cb43d commit 2a33065

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/pause.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const pause = function (passedObject = {}) {
3737
})
3838

3939
event.dispatcher.on(event.test.finished, () => {
40-
finish()
40+
if (typeof finish === 'function') finish()
4141
recorder.session.restore('pause')
4242
rl.close()
4343
history.save()
@@ -94,7 +94,7 @@ async function parseInput(cmd) {
9494
recorder.session.start('pause')
9595
if (cmd === '') next = true
9696
if (!cmd || cmd === 'resume' || cmd === 'exit') {
97-
finish()
97+
if (typeof finish === 'function') finish()
9898
recorder.session.restore('pause')
9999
rl.close()
100100
history.save()

0 commit comments

Comments
 (0)