Skip to content

Commit

Permalink
path is not always a string, ensure it isn\'t false-y before access…
Browse files Browse the repository at this point in the history
…ing it
  • Loading branch information
patrickkettner committed Dec 7, 2021
1 parent b4c4d96 commit a8fe715
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/AmpConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const AmpConfig = (providedOptions) => {
throw new Error(`filter needs to be a valid RegExp, provided : ${options.filter}`);
}

options.isAmp = (path) => path.endsWith('.html') && options.filter.test(path);
options.isAmp = (path) => path && path.endsWith('.html') && options.filter.test(path);

if (providedOptions.optimizeImages !== false && !providedOptions.imageOptimizer) {
options.imageOptimizer = ImageOptimizer.create(options);
Expand Down

0 comments on commit a8fe715

Please sign in to comment.