Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit a3c0364

Browse files
if no cp, remove payments
1 parent 468d96a commit a3c0364

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/copilotPaymentService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ async function setCopilotPayment (challengeLegacyId, amount, createdBy, updatedB
9999
const copilotResourceId = await getCopilotResourceId(connection, challengeLegacyId)
100100
const copilotPayment = await getCopilotPayment(connection, challengeLegacyId)
101101
const copilotProjectPayment = await getCopilotProjectPayment(connection, copilotResourceId)
102-
if (amount !== null && amount >= 0) {
102+
if (amount !== null && amount >= 0 && copilotResourceId) {
103103
if (copilotPayment) {
104104
logger.debug(`Copilot payment exists, updating: ${challengeLegacyId}`)
105105
await updateCopilotPayment(connection, copilotResourceId, challengeLegacyId, amount, updatedBy)

0 commit comments

Comments
 (0)