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

Commit

Permalink
Throw error if unable to retrieve information for the selected tab
Browse files Browse the repository at this point in the history
  • Loading branch information
nerrad committed Jan 3, 2020
1 parent aeadf14 commit c21db2a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions assets/js/base/components/tabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ const Tabs = ( {
onSelect( tabKey );
};
const selectedTab = find( tabs, { name: selected } );
if ( ! selectedTab ) {
throw new Error( 'There is no available tab for the selected item' );
}
const selectedId = `${ instanceId }-${ selectedTab.name }`;
return (
<div className={ classnames( 'wc-component__tabs', className ) }>
Expand Down

0 comments on commit c21db2a

Please sign in to comment.