ensure Metamaps[prop] is an object

This commit is contained in:
Devin Howard 2016-02-29 11:49:14 +08:00
parent 6cd988fb31
commit b64558f860

View file

@ -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();
}