vocadb
vocadb copied to clipboard
Updating user fails if user has special characters in email
When updating user (User/Edit)
System.FormatException The specified string is not in the form required for an e-mail address. Int32 ReadCfwsAndThrowIfIncomplete(System.String, Int32) at System.Net.Mail.MailAddressParser.ReadCfwsAndThrowIfIncomplete(String data, Int32 index)
at System.Net.Mail.MailAddressParser.ParseDomain(String data, Int32& index)
at System.Net.Mail.MailAddressParser.ParseAddress(String data, Boolean expectMultipleAddresses, Int32& index)
at System.Net.Mail.MailAddressParser.ParseAddress(String data)
at System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding)
at VocaDb.Model.Database.Queries.UserQueries.<>c__DisplayClass76_0.<UpdateUser>b__1(IDatabaseContext`1 session, User user) in C:\Sites\UtaiteDB\web\VocaDbModel\Database\Queries\UserQueries.cs:line 0
User's email has a dot.
I tried to fix this issue but in vain. Could you please provide me more details?
I can't reproduce it either now with the dot. But if you enter for example email "miku" without @, then it will throw unhandled exception from MailAddressNormalizer.Normalize. Maybe you could add a try/catch to that?
Thank you for your help. Could you please review this PR just in case?
This issue seems to be resolved.