diff --git a/src/command.ts b/src/command.ts index d9903e1..a01ba34 100644 --- a/src/command.ts +++ b/src/command.ts @@ -1279,6 +1279,9 @@ function templateInner( if (exprs.length > i) { try { const expr = exprs[i]; + if (expr == null) { + throw "Expression was null or undefined."; + } const inputOrOutputRedirect = detectInputOrOutputRedirect(text); if (inputOrOutputRedirect === "<") { if (expr instanceof Path) {