diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 37c1e559c..a7dea2c3e 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -816,7 +816,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { return; } let target = event.target as HTMLElement; - if (target.classList.contains("av__gallery-img")) { + if (target.classList?.contains("av__gallery-img")) { target = hasClosestByClassName(target, "av__gallery-item") as HTMLElement; } if (!target) {