diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 0ced42c7eac..9129f527fe6 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -155,6 +155,12 @@ export interface IExecutionResult { } async function exec(child: cp.ChildProcess, options: any = {}): Promise { + if (!child.stdout || !child.stderr) { + throw new GitError({ + message: 'Failed to get stdout or stderr from git process.' + }); + } + const disposables: IDisposable[] = []; const once = (ee: NodeJS.EventEmitter, name: string, fn: Function) => {