add an early-return to getHrefContainerProps to avoid similar bugs

This commit is contained in:
James Fenn
2024-01-27 16:28:05 -05:00
parent 60cad84205
commit e0f2604093

View File

@@ -99,6 +99,9 @@ globalThis.handleHrefContainerClick = (e: MouseEvent) => {
}; };
export function getHrefContainerProps(href: string) { export function getHrefContainerProps(href: string) {
// If the href is null or empty, no props should be added
if (!href) return {};
// hack to detect whether the function is in an Astro or Preact environment, // hack to detect whether the function is in an Astro or Preact environment,
// assuming that Preact is only used outside of a node environment // assuming that Preact is only used outside of a node environment
if ( if (