Skip to content

Commit 5c9f3ab

Browse files
committed
fix(runtime-dom): fix crash when modifier is empty
1 parent 04d2c05 commit 5c9f3ab

File tree

1 file changed

+5
-1
lines changed
  • packages/runtime-dom/src/directives

1 file changed

+5
-1
lines changed

packages/runtime-dom/src/directives/vOn.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ const modifierGuards: Record<
3535
export const withModifiers = <
3636
T extends (event: Event, ...args: unknown[]) => any
3737
>(
38-
fn: T & { _withMods?: { [key: string]: T } },
38+
fn: T & { _withMods?: { [key: string]: T } } ,
3939
modifiers: string[]
4040
) => {
41+
42+
if(!fn) {
43+
return
44+
}
4145
const cache = fn._withMods || (fn._withMods = {})
4246
const cacheKey = modifiers.join('.')
4347
return (

0 commit comments

Comments
 (0)