Merge pull request #314 from Bond-009/fix303
Fixes possible NullReferenceException
This commit is contained in:
commit
77a15fe404
|
@ -112,12 +112,15 @@ namespace Emby.Server.Implementations.HttpServer
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private IHasHeaders GetHttpResult(IRequest requestContext, byte[] content, string contentType, bool addCachePrevention, IDictionary<string, string> responseHeaders = null)
|
private IHasHeaders GetHttpResult(IRequest requestContext, byte[] content, string contentType, bool addCachePrevention, IDictionary<string, string> responseHeaders = null)
|
||||||
{
|
{
|
||||||
|
string compressionType = null;
|
||||||
|
bool isHeadRequest = false;
|
||||||
|
|
||||||
|
if (requestContext != null) {
|
||||||
|
compressionType = GetCompressionType(requestContext, content, contentType);
|
||||||
|
isHeadRequest = string.Equals(requestContext.Verb, "head", StringComparison.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
IHasHeaders result;
|
IHasHeaders result;
|
||||||
|
|
||||||
var compressionType = requestContext == null ? null : GetCompressionType(requestContext, content, contentType);
|
|
||||||
|
|
||||||
var isHeadRequest = string.Equals(requestContext.Verb, "head", StringComparison.OrdinalIgnoreCase);
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(compressionType))
|
if (string.IsNullOrEmpty(compressionType))
|
||||||
{
|
{
|
||||||
var contentLength = content.Length;
|
var contentLength = content.Length;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user