forked from Mirrors/gomuks
web/lightbox: ignore open call without src
This commit is contained in:
parent
7ef6509d46
commit
2fc1aff753
1 changed files with 3 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue