Fix build delete action 500 error if build does not exist

This commit is contained in:
Kalle 2026-05-03 14:34:03 +03:00
parent 92c62746be
commit 767ca4d7ab

View File

@ -257,9 +257,9 @@ export async function ownerIdById(buildId: number) {
.selectFrom("Build")
.select("ownerId")
.where("id", "=", buildId)
.executeTakeFirstOrThrow();
.executeTakeFirst();
return result.ownerId;
return result?.ownerId ?? null;
}
export async function abilityPointAverages(weaponSplId?: MainWeaponId | null) {