Skip to content

Commit 94a64cf

Browse files
committed
Check that args are strings before doing macro tests so we don't throw if the source is nil
1 parent a70b6b0 commit 94a64cf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fnl/nfnl/compile.fnl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
(or (not line) (header.tagged? line))))
1818

1919
(fn M.macro-source? [{: source : path}]
20-
(or (and (string.find source "%s*;+%s*%[nfnl%-macro%]") true)
21-
(and path (str.ends-with? path ".fnlm"))))
20+
(or (and (core.string? source) (string.find source "%s*;+%s*%[nfnl%-macro%]") true)
21+
(and (core.string? path) path (str.ends-with? path ".fnlm"))))
2222

2323
(fn valid-source-files [glob-fn {: root-dir : cfg}]
2424
"Return a list of all files we're allowed to compile. These are found by

lua/nfnl/compile.lua

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)