Skip to content

Commit 929bdfc

Browse files
committed
fix: throw on empty lists in mailingListConnectOrUpdate (CM-1318)
Signed-off-by: Uroš Marolt <uros@marolt.me>
1 parent 6262729 commit 929bdfc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

backend/src/services/integrationService.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,9 +1443,11 @@ export default class IntegrationService {
14431443
) {
14441444
const lists = integrationData.lists || []
14451445

1446+
// Both current callers (mailingListAuthenticate.ts, create-mailing-list-integration.ts)
1447+
// validate against bodySchema's `.min(1)` before reaching here, so this is an invariant
1448+
// check, not user-facing validation — fail loudly rather than silently no-op.
14461449
if (lists.length === 0) {
1447-
this.options.log.warn('No lists provided - skipping mailing list integration update')
1448-
return null
1450+
throw new Error400(this.options.language, 'errors.validation.message')
14491451
}
14501452

14511453
const currentOptions = options || this.options

0 commit comments

Comments
 (0)