diff --git a/lib/Launcher.js b/lib/Launcher.js index 49f5e706..feac7173 100644 --- a/lib/Launcher.js +++ b/lib/Launcher.js @@ -55,7 +55,7 @@ class Launcher { options = options || {}; let temporaryUserDataDir = null; const chromeArguments = [].concat(DEFAULT_ARGS); - if (!options.args.some(arg => arg.startsWith('--user-data-dir'))) { + if (!options.args || !options.args.some(arg => arg.startsWith('--user-data-dir'))) { if (!options.userDataDir) temporaryUserDataDir = fs.mkdtempSync(CHROME_PROFILE_PATH);