From 05142ebcdb5308becaa11135b1f49e5348f8d051 Mon Sep 17 00:00:00 2001 From: Hyunseung Date: Wed, 29 Nov 2023 21:52:25 +0900 Subject: [PATCH] handle when data is undefined --- src/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions.js b/src/functions.js index 6d82fbe..88d7981 100644 --- a/src/functions.js +++ b/src/functions.js @@ -2,7 +2,7 @@ import { gaStore } from './store.js' function addEvent (event, data) { - if (!data.send_to) { delete data.send_to } + if (data && !data.send_to) { delete data.send_to } gaStore.update(exisiting => [ ...exisiting, { type: 'event', event, data } ]) }