Skip to content

Commit

Permalink
fix: use default href values to avoid errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Benj0s committed Aug 6, 2024
1 parent bdd6e0c commit a9bf536
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/cms-modern/Search/SearchResultsListing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const SearchResultsListing = (props: SearchResultsListingProps) => {
<li>
<h3 className="search__results__listing__heading">Products</h3>
<ul className="search__results__section">
{searchResults.map(({ id, name, variants, href }: any, index: number) => {
{searchResults.map(({ id, name, variants, href = '' }: any, index: number) => {
// Need to manipulate the image url for smart imaging and resize for performance
let firstImage: string = '';
if (variants[0].images) {
Expand Down Expand Up @@ -79,7 +79,7 @@ const SearchResultsListing = (props: SearchResultsListingProps) => {
<li>
<h3 className="search__results__listing__heading">Categories</h3>
<ul className="search__results__section">
{categories.map(({ label, count, href }: any, index: number) => {
{categories.map(({ label, count, href = '' }: any, index: number) => {
return (
<li key={index}>
<Link passHref href={href}>
Expand Down Expand Up @@ -124,7 +124,7 @@ const SearchResultsListing = (props: SearchResultsListingProps) => {
<li>
<h3 className="search__results__listing__heading">Inspiration</h3>
<ul className="search__results__section">
{inspiration.map(({ label, href, count }: any, index: number) => {
{inspiration.map(({ label, href = '', count }: any, index: number) => {
return (
<li key={index}>
<Link passHref href={href}>
Expand Down

0 comments on commit a9bf536

Please sign in to comment.