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.
This commit is contained in:
dongresource 2023-03-13 05:58:49 +01:00
parent 743a39c125
commit e73daa0865

View File

@ -662,6 +662,8 @@ static void loadEggs(json& eggData, int32_t* nextId) {
* Load gruntwork output, if it exists * Load gruntwork output, if it exists
*/ */
static void loadGruntworkPre(json& gruntwork, int32_t* nextId) { static void loadGruntworkPre(json& gruntwork, int32_t* nextId) {
if (gruntwork.is_null())
return;
try { try {
auto paths = gruntwork["paths"]; auto paths = gruntwork["paths"];
@ -711,8 +713,8 @@ static void loadGruntworkPre(json& gruntwork, int32_t* nextId) {
} }
static void loadGruntworkPost(json& gruntwork, int32_t* nextId) { static void loadGruntworkPost(json& gruntwork, int32_t* nextId) {
if (gruntwork.is_null())
if (gruntwork.is_null()) return; return;
try { try {
// skyway paths // skyway paths