From 6fc58e9134803fc74a24bc0514542ce8ff1d347c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 23 May 2022 14:43:21 -0300 Subject: fix kinda harmless error in yaml quick load util --- src/data/yaml.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/data/yaml.js b/src/data/yaml.js index 010fce4c..32cf7292 100644 --- a/src/data/yaml.js +++ b/src/data/yaml.js @@ -1170,16 +1170,20 @@ export function filterDuplicateDirectories(wikiData) { }); } + // TODO: This code closes the aggregate but it generally gets closed again + // by the caller. This works but it might be weird to assume closing an + // aggregate twice is okay, maybe there's a better solution? Expose a new + // function on aggregates for checking if it *would* error? + // (i.e: errors.length > 0) try { aggregate.close(); - return aggregate; } catch (error) { // Duplicate entries were found and filtered out, resulting in altered // wikiData arrays. These must be re-linked so objects receive the new // data. linkWikiDataArrays(wikiData); - return error; } + return aggregate; } // Warn about references across data which don't match anything. This involves -- cgit 1.3.0-6-gf8a5