Don't crash on no args

This commit is contained in:
Ryan Cavanaugh 2018-06-05 14:14:16 -07:00
parent e40778070e
commit 449d60cdff

View File

@ -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);
}