Skip to content

Commit

Permalink
fix: fix Cannot read properties of null
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Dec 11, 2022
1 parent 0e87631 commit 56fb74e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/events/pr-handlers/utils/createPullRequestContext.ts
Expand Up @@ -70,6 +70,7 @@ export const getReviewflowPrContext = async <T extends EventsWithRepository>(
await appContext.mongoStores.prs.partialUpdateByKey(existing._id, {
$set: { commentId: newComment.id },
});
return { reviewflowPr: existing, commentBody: newComment.body! };
}
} else if (!existing) {
const reviewflowPr = await appContext.mongoStores.prs.insertOne({
Expand All @@ -81,5 +82,5 @@ export const getReviewflowPrContext = async <T extends EventsWithRepository>(
return { reviewflowPr, commentBody: comment.body! };
}

return { reviewflowPr: existing, commentBody: comment!.body! };
return { reviewflowPr: existing, commentBody: comment.body! };
};

0 comments on commit 56fb74e

Please sign in to comment.