From c4a37ff95de241ab254856469b8e539436bf5798 Mon Sep 17 00:00:00 2001 From: Sean O'Donohue Date: Thu, 7 Feb 2019 21:15:48 -0500 Subject: [PATCH] Check for valid input event. --- src/BundleManager.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/BundleManager.js b/src/BundleManager.js index b7b81a16..75da0e05 100644 --- a/src/BundleManager.js +++ b/src/BundleManager.js @@ -503,6 +503,10 @@ class BundleManager { const loader = require(eventPath); const eventImport = this._getLoader(loader, srcPath); + if (typeof eventImport.event !== 'function') { + throw new Error(`Bundle ${bundle} has an invalid input event '${eventName}'. Expected a function, got: `, eventImport.event); + } + this.state.InputEventManager.add(eventName, eventImport.event(this.state)); }