From c8709835c98435d02d8ce2ef013e71340a00005d Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 9 May 2022 12:30:13 +0200 Subject: [PATCH] =?UTF-8?q?Do=20not=20panic=20in=20=E2=80=98os=E2=80=99=20?= =?UTF-8?q?module=20if=20argv.Length()=20is=200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compiler/natives/src/os/os.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/natives/src/os/os.go b/compiler/natives/src/os/os.go index 1dc05cbd0..a45e13508 100644 --- a/compiler/natives/src/os/os.go +++ b/compiler/natives/src/os/os.go @@ -18,7 +18,7 @@ func runtime_args() []string { // not called on Windows func init() { if process := js.Global.Get("process"); process != js.Undefined { - if argv := process.Get("argv"); argv != js.Undefined { + if argv := process.Get("argv"); argv != js.Undefined && argv.Length() >= 1 { Args = make([]string, argv.Length()-1) for i := 0; i < argv.Length()-1; i++ { Args[i] = argv.Index(i + 1).String()