1
0
Fork 0
forked from Mirrors/gomuks

web/lightbox: ignore open call without src

This commit is contained in:
Tulir Asokan 2024-10-14 00:45:32 +03:00
parent 7ef6509d46
commit 2fc1aff753

View file

@ -40,6 +40,9 @@ export const LightboxWrapper = ({ children }: { children: React.ReactNode }) =>
if ((params as React.MouseEvent).target) {
const evt = params as React.MouseEvent<HTMLImageElement>
const target = evt.currentTarget as HTMLImageElement
if (!target.src) {
return
}
setParams({
src: target.src,
alt: target.alt,