diff --git a/lib/readline-sync.js b/lib/readline-sync.js index cc54f25..587e81f 100644 --- a/lib/readline-sync.js +++ b/lib/readline-sync.js @@ -266,7 +266,7 @@ function readlineExt(options) { try { res.input = childProc.execFileSync(extHostPath, hostArgs, execOptions); } catch (e) { // non-zero exit code - extMessage = e.stderr.trim(); + extMessage = e.stderr ? (e.stderr + '').trim() : ''; res.error = new Error(DEFAULT_ERR_MSG + (extMessage ? '\n' + extMessage : '')); res.error.method = 'execFileSync'; res.error.program = extHostPath;