Skip to content

Commit

Permalink
Fixed EncodeAddrspec and DecodeAddrspec to handle string.Empty
Browse files Browse the repository at this point in the history
Fixes issue #302
  • Loading branch information
jstedfast committed Apr 24, 2017
1 parent 54369a4 commit 5343590
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions MimeKit/MailboxAddress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ public static string EncodeAddrspec (string addrspec)
throw new ArgumentNullException (nameof (addrspec));

#if !PORTABLE
if (addrspec.Length == 0)
return addrspec;

var buffer = CharsetUtils.UTF8.GetBytes (addrspec);
int at, index = 0;
string address;
Expand Down Expand Up @@ -384,6 +387,9 @@ public static string DecodeAddrspec (string addrspec)
throw new ArgumentNullException (nameof (addrspec));

#if !PORTABLE
if (addrspec.Length == 0)
return addrspec;

var buffer = CharsetUtils.UTF8.GetBytes (addrspec);
int at, index = 0;
string address;
Expand Down

0 comments on commit 5343590

Please sign in to comment.