Add null checks in feedback processing pipeline (FRE-4514)
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -253,6 +253,18 @@ export class SpamShieldService {
|
||||
throw new Error('Feedback loop disabled via feature flag');
|
||||
}
|
||||
|
||||
if (!userId || typeof userId !== 'string' || userId.trim().length === 0) {
|
||||
throw new Error('Feedback: userId is required');
|
||||
}
|
||||
|
||||
if (!phoneNumber || typeof phoneNumber !== 'string') {
|
||||
throw new Error('Feedback: phoneNumber must be a non-empty string');
|
||||
}
|
||||
|
||||
if (typeof isSpam !== 'boolean') {
|
||||
throw new Error('Feedback: isSpam must be a boolean');
|
||||
}
|
||||
|
||||
const validated = this.validatePhoneNumber(phoneNumber);
|
||||
const encrypted = FieldEncryptionService.encrypt(validated);
|
||||
const hash = FieldEncryptionService.hashPhoneNumber(validated);
|
||||
|
||||
Reference in New Issue
Block a user