From f748e3c41b9cbcb160df8518b9a846942a7b4556 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 29 Mar 2020 15:33:36 -0400 Subject: [PATCH] Fix ownerless objects not spawning --- media/attribution.js | 17 ++++++++++++----- presets/cities.js | 2 -- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/media/attribution.js b/media/attribution.js index b65ad2b5..2efb6ac8 100644 --- a/media/attribution.js +++ b/media/attribution.js @@ -11383,10 +11383,15 @@ function ownersOf(file) { function ownersOfFull(file) { const result = []; if (attribution.files[file]) { - attribution.files[file].owners.forEach(owner => { - result.push(attributionData.people[owner]); - }); - return result; + if (attribution.files[file].owners) { + attribution.files[file].owners.forEach(owner => { + result.push(attributionData.people[owner]); + }); + return result; + } + else { + return []; + } } else { const found = attribution.prefixes[Object.keys(attribution.prefixes).find(path => { @@ -11394,8 +11399,10 @@ function ownersOfFull(file) { })]; - if (found === undefined || found.owners === undefined) { + if (found === undefined) { return undefined; + } else if (found.owners === undefined) { + return []; } else { found.owners.forEach(owner => { result.push(attributionData.people[owner]); diff --git a/presets/cities.js b/presets/cities.js index 0962afad..7847ca6b 100644 --- a/presets/cities.js +++ b/presets/cities.js @@ -17,8 +17,6 @@ function makeCity(name, height) { }, }; - console.log(views) - return makeEntity({ name: name }, views); }