Skip to content

Commit 0cfdc8b

Browse files
committed
Fixed ImapUtils.ParseContentType to handle a null type
1 parent efc8ba8 commit 0cfdc8b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

MailKit/Net/Imap/ImapUtils.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,7 @@ static ContentType ParseContentType (ImapEngine engine, string format, Cancellat
11511151
}
11521152
}
11531153
} else {
1154+
type ??= "application";
11541155
subtype = ReadStringToken (engine, format, cancellationToken);
11551156
}
11561157

@@ -1207,6 +1208,7 @@ static async Task<ContentType> ParseContentTypeAsync (ImapEngine engine, string
12071208
}
12081209
}
12091210
} else {
1211+
type ??= "application";
12101212
subtype = await ReadStringTokenAsync (engine, format, cancellationToken).ConfigureAwait (false);
12111213
}
12121214

0 commit comments

Comments
 (0)