From 7308f2dda60a832ff079a16a506fc1a1fdaaf62c Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Mon, 13 Aug 2018 10:54:14 +0200 Subject: [PATCH] :rotating_light: Better handling of array check --- src/pattern.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pattern.js b/src/pattern.js index 96d51b6eaaa..c4bb02d9665 100644 --- a/src/pattern.js +++ b/src/pattern.js @@ -223,7 +223,10 @@ Pattern.prototype.loadPluginHooks = function(plugin) { for (let hook of this.hooks.all) { if (typeof plugin.hooks[hook] === "function") { this.on(hook, plugin.hooks[hook]); - } else if (typeof plugin.hooks[hook] === "array") { + } else if ( + typeof plugin.hooks[hook] !== "undefined" && + plugin.hooks[hook].isArray() + ) { for (let method of plugin.hooks[hook]) { this.on(hook, method); }