From b64558f860776d1f491ef11cf4c26fba316d4fc8 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Mon, 29 Feb 2016 11:49:14 +0800 Subject: [PATCH] ensure Metamaps[prop] is an object --- app/assets/javascripts/src/Metamaps.GlobalUI.js.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/src/Metamaps.GlobalUI.js.erb b/app/assets/javascripts/src/Metamaps.GlobalUI.js.erb index 27812c57..7fb640ae 100644 --- a/app/assets/javascripts/src/Metamaps.GlobalUI.js.erb +++ b/app/assets/javascripts/src/Metamaps.GlobalUI.js.erb @@ -49,7 +49,8 @@ $(document).ready(function () { // this runs the init function within each sub-object on the Metamaps one if (Metamaps.hasOwnProperty(prop) && Metamaps[prop].hasOwnProperty('init') && - typeof (Metamaps[prop].init) == 'function' + typeof Metamaps[prop] === 'object' && + typeof (Metamaps[prop].init) === 'function' ) { Metamaps[prop].init(); }