diff --git a/src/repositories/projectRoundRecordRepository.ts b/src/repositories/projectRoundRecordRepository.ts index 9ee337e5a..90db761d9 100644 --- a/src/repositories/projectRoundRecordRepository.ts +++ b/src/repositories/projectRoundRecordRepository.ts @@ -18,6 +18,9 @@ export async function updateOrCreateProjectRoundRecord( qfRoundId?: number | null, earlyAccessRoundId?: number | null, ): Promise { + if (!qfRoundId && !earlyAccessRoundId) { + throw new Error('No round specified on updateOrCreateProjectRoundRecord'); + } try { let query = Donation.createQueryBuilder('donation') .select('SUM(COALESCE(donation.amount))', 'totalDonationAmount') diff --git a/src/resolvers/donationResolver.ts b/src/resolvers/donationResolver.ts index 8fc58f5dd..24d9a638e 100644 --- a/src/resolvers/donationResolver.ts +++ b/src/resolvers/donationResolver.ts @@ -897,6 +897,10 @@ export class DonationResolver { activeQfRoundForProject.isEligibleNetwork(networkId) ) { donation.qfRound = activeQfRoundForProject; + } else { + throw new Error( + i18n.__(translationErrorMessagesKeys.ROUND_NOT_FOUND), + ); } if (draftDonationEnabled && draftDonationId) { const draftDonation = await DraftDonation.findOne({