Skip to content

Commit fba9a75

Browse files
Only insert fields to projects if exists
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
1 parent b555877 commit fba9a75

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/config/resource-config.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ export class ResourceConfig extends Config {
8282
const projObj = new Project(orgData.name, projData.number);
8383
await projObj.setContext(this.octokit);
8484

85-
for (const projFieldData of projData.fields) {
86-
const projFieldObj = new ProjectField(orgData.name, projData.number, projFieldData.name);
87-
await projFieldObj.setContext(this.octokit, projObj.getNodeId());
88-
projObj.addField(projFieldObj);
85+
if (projData.fields) {
86+
for (const projFieldData of projData.fields) {
87+
const projFieldObj = new ProjectField(orgData.name, projData.number, projFieldData.name);
88+
await projFieldObj.setContext(this.octokit, projObj.getNodeId());
89+
projObj.addField(projFieldObj);
90+
}
8991
}
9092
projObjMap.set(projData.number, projObj);
9193
}

0 commit comments

Comments
 (0)