mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 11:40:39 +09:00
Merge pull request #2594 from plind-dm/fix/checkout-null-assertion-crash
fix(issues): replace non-null assertions with null checks in checkout…
This commit is contained in:
commit
47299c511e
1 changed files with 4 additions and 2 deletions
|
|
@ -1469,7 +1469,8 @@ export function issueService(db: Db) {
|
||||||
expectedCheckoutRunId: current.checkoutRunId,
|
expectedCheckoutRunId: current.checkoutRunId,
|
||||||
});
|
});
|
||||||
if (adopted) {
|
if (adopted) {
|
||||||
const row = await db.select().from(issues).where(eq(issues.id, id)).then((rows) => rows[0]!);
|
const row = await db.select().from(issues).where(eq(issues.id, id)).then((rows) => rows[0] ?? null);
|
||||||
|
if (!row) throw notFound("Issue not found");
|
||||||
const [enriched] = await withIssueLabels(db, [row]);
|
const [enriched] = await withIssueLabels(db, [row]);
|
||||||
return enriched;
|
return enriched;
|
||||||
}
|
}
|
||||||
|
|
@ -1481,7 +1482,8 @@ export function issueService(db: Db) {
|
||||||
current.status === "in_progress" &&
|
current.status === "in_progress" &&
|
||||||
sameRunLock(current.checkoutRunId, checkoutRunId)
|
sameRunLock(current.checkoutRunId, checkoutRunId)
|
||||||
) {
|
) {
|
||||||
const row = await db.select().from(issues).where(eq(issues.id, id)).then((rows) => rows[0]!);
|
const row = await db.select().from(issues).where(eq(issues.id, id)).then((rows) => rows[0] ?? null);
|
||||||
|
if (!row) throw notFound("Issue not found");
|
||||||
const [enriched] = await withIssueLabels(db, [row]);
|
const [enriched] = await withIssueLabels(db, [row]);
|
||||||
return enriched;
|
return enriched;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue