From f6067f7b351e220429693c4e968e758c58f59809 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Sat, 5 Nov 2022 10:55:55 -0400 Subject: [PATCH] sometimes there are no arg 0 --- cgi.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cgi.d b/cgi.d index aad9760..fb8ddab 100644 --- a/cgi.d +++ b/cgi.d @@ -957,7 +957,7 @@ class Cgi { { import core.runtime; auto sfn = getenv("SCRIPT_FILENAME"); - scriptFileName = sfn.length ? sfn : Runtime.args[0]; + scriptFileName = sfn.length ? sfn : (Runtime.args.length ? Runtime.args[0] : null); } bool iis = false; @@ -1751,7 +1751,7 @@ class Cgi { { import core.runtime; - scriptFileName = Runtime.args[0]; + scriptFileName = Runtime.args.length ? Runtime.args[0] : null; }