From 2fc1aff753287de64afde398dc0a206d0798a709 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 14 Oct 2024 00:45:32 +0300 Subject: [PATCH] web/lightbox: ignore open call without src --- web/src/ui/Lightbox.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/src/ui/Lightbox.tsx b/web/src/ui/Lightbox.tsx index 7f6b383..930731d 100644 --- a/web/src/ui/Lightbox.tsx +++ b/web/src/ui/Lightbox.tsx @@ -40,6 +40,9 @@ export const LightboxWrapper = ({ children }: { children: React.ReactNode }) => if ((params as React.MouseEvent).target) { const evt = params as React.MouseEvent const target = evt.currentTarget as HTMLImageElement + if (!target.src) { + return + } setParams({ src: target.src, alt: target.alt,