Skip to content

Commit

Permalink
fix(plugin-user-data-dir): Check userDataDir before attempting removal (
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottPierce authored Mar 1, 2023
1 parent 8ad9ea4 commit f7fdb83
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/puppeteer-extra-plugin-user-data-dir/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ class Plugin extends PuppeteerExtraPlugin {
deleteUserDataDir() {
debug('removeUserDataDir', this._userDataDir)

if (!this._userDataDir) {
console.warn('No userDataDir, not running rimraf')
return
}

// We're using rimraf here because it throw errors and don't seem to freeze the process
// If ressources busy or locked by chrome try again 4 times, then give up. overall a timout of 400ms
rimraf(
Expand Down

0 comments on commit f7fdb83

Please sign in to comment.