Skip to content

Commit

Permalink
Use token.Value.ToString() to avoid char->string cast exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jstedfast committed Oct 6, 2023
1 parent 8ccd5a6 commit e0005fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MailKit/Net/Imap/ImapEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ void UpdateCapabilities (ImapTokenType sentinel, CancellationToken cancellationT
//
// See https://github.com/jstedfast/MailKit/issues/1654 for details.
while (token.Type == ImapTokenType.Atom || token.Type == ImapTokenType.Plus) {
var atom = (string) token.Value;
var atom = token.Value.ToString ();

ProcessCapabilityToken (atom);

Expand All @@ -1516,7 +1516,7 @@ async Task UpdateCapabilitiesAsync (ImapTokenType sentinel, CancellationToken ca
//
// See https://github.com/jstedfast/MailKit/issues/1654 for details.
while (token.Type == ImapTokenType.Atom || token.Type == ImapTokenType.Plus) {
var atom = (string) token.Value;
var atom = token.Value.ToString ();

ProcessCapabilityToken (atom);

Expand Down

0 comments on commit e0005fc

Please sign in to comment.