Skip to content

Commit

Permalink
fix: #6097 - check for root stack when loading projects for sanity ch…
Browse files Browse the repository at this point in the history
…eck (#6121)
  • Loading branch information
Attila Hajdrik committed Dec 11, 2020
1 parent e6519f2 commit 6ebe735
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ export function loadDiffableProject(path: string, rootStackName: string): Diffab
root: {},
};
for (const key of Object.keys(currentStacks)) {
diffableProject.stacks[key] = JSON.parse(project.stacks[key]);
diffableProject.stacks[key] = JSONUtilities.parse(project.stacks[key]);
}
if (project[rootStackName]) {
diffableProject.root = JSONUtilities.parse(project[rootStackName]);
}
diffableProject.root = JSON.parse(project[rootStackName]);
return diffableProject;
}

Expand Down
4 changes: 3 additions & 1 deletion packages/graphql-transformer-core/src/util/sanity-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,9 @@ const loadDiffableProject = async (path: string, rootStackName: string): Promise
diffableProject.stacks[key] = JSONUtilities.parse(project.stacks[key]);
}

diffableProject.root = JSONUtilities.parse(project[rootStackName]);
if (project[rootStackName]) {
diffableProject.root = JSONUtilities.parse(project[rootStackName]);
}

return diffableProject;
};

0 comments on commit 6ebe735

Please sign in to comment.