Skip to content

Commit

Permalink
chore: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagowfx committed Oct 23, 2023
1 parent 2aea381 commit a76c1d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/puppeteer-core/src/node/ChromeLauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ export class ChromeLauncher extends ProductLauncher {
'--disable-features',
options.args
);
if (userDisabledFeatures.length > 0) {
removeMatching(options.args ?? [], /^--disable-features=.*/);
if (options.args && userDisabledFeatures.length > 0) {
removeMatching(options.args, /^--disable-features=.*/);
}

// Merge default disabled features with user-provided ones, if any.
Expand All @@ -187,8 +187,8 @@ export class ChromeLauncher extends ProductLauncher {
];

const userEnabledFeatures = getFeatures('--enable-features', options.args);
if (userEnabledFeatures.length > 0) {
removeMatching(options.args ?? [], /^--enable-features=.*/);
if (options.args && userEnabledFeatures.length > 0) {
removeMatching(options.args, /^--enable-features=.*/);
}

// Merge default enabled features with user-provided ones, if any.
Expand Down

0 comments on commit a76c1d2

Please sign in to comment.