From e143758c5edc6f3203459cf11444bcfa0ec3a644 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Mon, 22 Apr 2024 14:07:51 +0300 Subject: [PATCH] Don't access undefined Signed-off-by: Yarden Shoham --- src/labels.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/labels.ts b/src/labels.ts index cb4bc5a..ce11537 100644 --- a/src/labels.ts +++ b/src/labels.ts @@ -56,7 +56,7 @@ const removeLabelsFromMergedPr = (labels: string[]) => { return Promise.all(labels.map(async (label) => { const prsThatAreMergedAndHaveTheLabel = await fetchMergedWithLabel(label); return Promise.all( - prsThatAreMergedAndHaveTheLabel.items.map( + prsThatAreMergedAndHaveTheLabel?.items?.map( (pr: { title: string; number: number }) => removeLabelFromMergedPr(pr, label), ),