Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Review feedback
  • Loading branch information
jamescrosswell committed Jun 16, 2025
commit e37422f8ef9f4e5c8956ed8c63b7f790ad5d569c
6 changes: 1 addition & 5 deletions src/Sentry/Internal/EmailValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ internal static partial class EmailValidator

#if NET9_0_OR_GREATER
[GeneratedRegex(EmailPattern)]
private static partial Regex EmailRegex { get; }
private static partial Regex Email { get; }
#elif NET8_0
[GeneratedRegex(EmailPattern)]
private static partial Regex EmailRegex();
Expand All @@ -32,10 +32,6 @@ public static bool IsValidEmail(string? email)
return true;
}

#if NET9_0_OR_GREATER
return EmailRegex.IsMatch(email);
#else
return Email.IsMatch(email);
#endif
}
}
2 changes: 1 addition & 1 deletion src/Sentry/Internal/Hub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ public void CaptureFeedback(SentryFeedback feedback, Action<Scope> configureScop

try
{
if (!EmailValidator.IsValidEmail(feedback.ContactEmail))
if (!string.IsNullOrWhiteSpace(feedback.ContactEmail) && !EmailValidator.IsValidEmail(feedback.ContactEmail))
{
_options.LogWarning("Feedback dropped due to invalid email format: '{0}'", feedback.ContactEmail);
return;
Expand Down
Loading