diff --git a/index.js b/index.js index 8fc0565..5bfd9b3 100644 --- a/index.js +++ b/index.js @@ -100,6 +100,12 @@ module.exports = (function () { } var getFilesForItem = function (item, callback) { + // If no data is available for the item, return. + if (!item || !item.data) { + callback(item); + return; + } + var relevantElements = [] if (Array.isArray(item.data.config)) { item.data.config.forEach(c => {