mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-09 21:09:51 +00:00
Fix null reference access when ContentType is null (#2501)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
#if !NO_SERIALIZABLE
|
||||
@@ -141,6 +142,16 @@ namespace Octokit.Tests.Exceptions
|
||||
Assert.NotNull(stringRepresentation);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DoesNotThrowIfContentTypeIsNotDefined()
|
||||
{
|
||||
var response = CreateResponse(HttpStatusCode.GatewayTimeout, null, new Dictionary<string, string>(), null);
|
||||
|
||||
var exception = new ApiException(response);
|
||||
var stringRepresentation = exception.ToString();
|
||||
Assert.NotNull(stringRepresentation);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DoesNotPrintImageContent()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user