Skip to content

Commit 73062d6

Browse files
authored
fix potentially fatal delete statement
1 parent 55384d8 commit 73062d6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

shdoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,12 @@ function unindent(text) {
240240
function reset() {
241241
debug("→ reset()")
242242

243-
delete docblock
243+
# Make sure the variable exists before deleting.
244+
# Without this, shdoc will fail for fully unannotated scripts.
245+
# This might happen when batch-handling a list of files
246+
if (typeof(docblock) != "unassigned"){
247+
delete docblock
248+
}
244249
description = ""
245250
}
246251

0 commit comments

Comments
 (0)