From e73daa0865418b73ac91d963698190d657c8f638 Mon Sep 17 00:00:00 2001 From: dongresource Date: Mon, 13 Mar 2023 05:58:49 +0100 Subject: [PATCH] Skip loadGruntworkPre() if there's no gruntwork Previously, only loadGruntworkPost() would be skipped if the gruntwork was null, but it was never null at that point because loadGruntworkPre() would inadvertently create gruntwork["paths"] when it indexes it to iterate through it. Now, the gruntwork loading messages will no longer be misleadingly printed to stdout when there isn't a gruntwork file. --- src/TableData.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/TableData.cpp b/src/TableData.cpp index 0a1310f..0a5ab5c 100644 --- a/src/TableData.cpp +++ b/src/TableData.cpp @@ -662,6 +662,8 @@ static void loadEggs(json& eggData, int32_t* nextId) { * Load gruntwork output, if it exists */ static void loadGruntworkPre(json& gruntwork, int32_t* nextId) { + if (gruntwork.is_null()) + return; try { auto paths = gruntwork["paths"]; @@ -711,8 +713,8 @@ static void loadGruntworkPre(json& gruntwork, int32_t* nextId) { } static void loadGruntworkPost(json& gruntwork, int32_t* nextId) { - - if (gruntwork.is_null()) return; + if (gruntwork.is_null()) + return; try { // skyway paths