Skip to content

Commit

Permalink
Check for valid input event.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean O'Donohue committed Feb 8, 2019
1 parent 31b1253 commit c4a37ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/BundleManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit c4a37ff

Please sign in to comment.