From 8be6c84e2f5aebbf58384b5b6b440e11c12e1d64 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 8 Jul 2019 12:10:57 +0200 Subject: [PATCH] guard against null elements in the drive --- www/common/outer/userObject.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/common/outer/userObject.js b/www/common/outer/userObject.js index e12883eb5..3aab20a1d 100644 --- a/www/common/outer/userObject.js +++ b/www/common/outer/userObject.js @@ -506,8 +506,14 @@ define([ var fixRoot = function (elem) { if (typeof(files[ROOT]) !== "object") { debug("ROOT was not an object"); files[ROOT] = {}; } var element = elem || files[ROOT]; + if (!element) { return console.error("Invalid element in root"); var nbMetadataFolders = 0; for (var el in element) { + if (element[el] === null) { + console.error('element[%s] is null', el); + delete element[el]; + continue; + } if (exp.isFolderData(element[el])) { if (nbMetadataFolders !== 0) { debug("Multiple metadata files in folder");