Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Wrap validation function execution in a try/catch block
Browse files Browse the repository at this point in the history
  • Loading branch information
Aljullu committed Feb 8, 2021
1 parent 2ae4382 commit 660c026
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/checkout/registry/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ export const __experimentalApplyCheckoutFilter = ( {
const filters = getCheckoutFilters( filterName );
let value = defaultValue;
filters.forEach( ( filter ) => {
const newValue = filter( value, args );
value = validate( newValue ) ? newValue : value;
try {
const newValue = filter( value, args );
value = validate( newValue ) ? newValue : value;
} catch ( e ) {
// eslint-disable-next-line no-console
console.log( e );
}
} );
return value;
};

0 comments on commit 660c026

Please sign in to comment.