diff --git a/src/SfCommandError.ts b/src/SfCommandError.ts index a04132864..0f94e7fc0 100644 --- a/src/SfCommandError.ts +++ b/src/SfCommandError.ts @@ -113,7 +113,7 @@ export class SfCommandError extends SfError { const aggregator: Array<{ flag: string; args: string[] }> = []; output.forEach((k, i) => { let argCounter = i + 1; - if (k.type === 'flag' && output[argCounter].type === 'arg') { + if (k.type === 'flag' && output[argCounter]?.type === 'arg') { const args: string[] = []; while (output[argCounter]?.type === 'arg') { args.push(output[argCounter].input);