From 449d60cdffdf43ef29f8202ff96da946b134bb05 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 5 Jun 2018 14:14:16 -0700 Subject: [PATCH] Don't crash on no args --- src/compiler/tsc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/tsc.ts b/src/compiler/tsc.ts index 744379aa696..149439d9b67 100644 --- a/src/compiler/tsc.ts +++ b/src/compiler/tsc.ts @@ -49,7 +49,7 @@ namespace ts { } export function executeCommandLine(args: string[]): void { - if ((args[0].toLowerCase() === "--build") || (args[0].toLowerCase() === "-b")) { + if (args.length > 0 && ((args[0].toLowerCase() === "--build") || (args[0].toLowerCase() === "-b"))) { return performBuild(createCompilerHost({}), createDiagnosticReporter(sys), args.slice(1), sys); }