From c3fa8bf3df50601bc125f28121bb471ebf24e911 Mon Sep 17 00:00:00 2001 From: coding Date: Thu, 12 Oct 2017 13:08:13 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BA=8B=E4=BB=B6=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=9C=AA=E5=88=A4=E6=96=AD=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/modules/event.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/resources/modules/event.js b/src/main/resources/modules/event.js index ee78d67..69eabe9 100644 --- a/src/main/resources/modules/event.js +++ b/src/main/resources/modules/event.js @@ -148,9 +148,12 @@ mapEventName(); module.exports = { on: listen, disable: function (jsp) { - jspListener[jsp.description.name].forEach(function (t) { - t.off(); - }); - delete jspListener[jsp.description.name]; + var jspl = jspListener[jsp.description.name]; + if (jspl) { + jspListener[jsp.description.name].forEach(function (t) { + t.off(); + }); + delete jspListener[jsp.description.name]; + } } }; \ No newline at end of file