diff --git a/MailKit/Net/Imap/ImapCommand.cs b/MailKit/Net/Imap/ImapCommand.cs index f3e7d64ce6..a029ce0873 100644 --- a/MailKit/Net/Imap/ImapCommand.cs +++ b/MailKit/Net/Imap/ImapCommand.cs @@ -907,7 +907,7 @@ public async Task StepAsync (bool doAsync) if (token.Type != ImapTokenType.Eoln) { // consume the rest of the line... var line = (await Engine.ReadLineAsync (doAsync, CancellationToken).ConfigureAwait (false)).TrimEnd (); - ResponseText = ((string) token.Value) + line; + ResponseText = token.Value.ToString () + line; break; } } else if (token.Type == ImapTokenType.OpenBracket) { diff --git a/MailKit/Net/Imap/ImapEngine.cs b/MailKit/Net/Imap/ImapEngine.cs index 38f2bcdb09..e46b11c0cd 100644 --- a/MailKit/Net/Imap/ImapEngine.cs +++ b/MailKit/Net/Imap/ImapEngine.cs @@ -675,7 +675,7 @@ public async Task ConnectAsync (ImapStream stream, bool doAsync, CancellationTok } } else if (token.Type != ImapTokenType.Eoln) { text = (await ReadLineAsync (doAsync, cancellationToken).ConfigureAwait (false)).TrimEnd (); - text = ((string) token.Value) + text; + text = token.Value.ToString () + text; if (bye) throw new ImapProtocolException (text); @@ -2045,7 +2045,7 @@ internal async Task ProcessUntaggedResponseAsync (bool doAsy current.RespCodes.Add (code); } else { var text = (await ReadLineAsync (doAsync, cancellationToken).ConfigureAwait (false)).TrimEnd (); - current.ResponseText = ((string) token.Value) + text; + current.ResponseText = token.Value.ToString () + text; } current.Bye = true; @@ -2097,7 +2097,7 @@ internal async Task ProcessUntaggedResponseAsync (bool doAsy current.RespCodes.Add (code); } else if (token.Type != ImapTokenType.Eoln) { var text = (await ReadLineAsync (doAsync, cancellationToken).ConfigureAwait (false)).TrimEnd (); - current.ResponseText = ((string) token.Value) + text; + current.ResponseText = token.Value.ToString () + text; } } else { if (uint.TryParse (atom, NumberStyles.None, CultureInfo.InvariantCulture, out uint number)) {