protect against subtly corrupted user objects

This commit is contained in:
ansuz
2017-03-30 17:19:49 +02:00
parent 7908f3b4f0
commit 9b4b642d4a
2 changed files with 2 additions and 1 deletions

View File

@@ -295,7 +295,7 @@ define([
paths.push(p);
}
};
if (path.length === 1) {
if (path.length === 1 && typeof(root) === 'object') {
Object.keys(root).forEach(function (key) {
var arr = root[key];
if (!Array.isArray(arr)) { return; }