Ensured missing content type does not crash network resource loader.

This commit is contained in:
Damian Büchel 2020-09-08 15:32:45 +02:00
parent 843744c70f
commit 8a385a55d0

View file

@ -146,7 +146,7 @@ namespace SafeExamBrowser.Configuration.DataResources
/// </remarks>
private bool HasHtmlContent(HttpResponseMessage response)
{
return response.Content.Headers.ContentType.MediaType == MediaTypeNames.Text.Html;
return response.Content.Headers.ContentType?.MediaType == MediaTypeNames.Text.Html;
}
private bool IsAvailable(Uri resource)