Skip to content

Commit

Permalink
fix(iframe): 修复 handler 为 undefined 时添加到 handlerCallbackMap 报错 (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Skyblue authored Mar 30, 2023
1 parent 1b45d30 commit 9b5a7fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/wujie-core/src/iframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ function patchDocumentEffect(iframeWindow: Window): void {
let callback = handlerCallbackMap.get(handler);
const typeList = handlerTypeMap.get(handler);
// 设置 handlerCallbackMap
if (!callback) {
if (!callback && handler) {
callback = typeof handler === "function" ? handler.bind(this) : handler;
handlerCallbackMap.set(handler, callback);
}
Expand Down

0 comments on commit 9b5a7fb

Please sign in to comment.