diff options
| author | bugfixin <steve@bugfix.in> | 2019-04-21 19:29:05 +0000 |
|---|---|---|
| committer | bugfixin <steve@bugfix.in> | 2019-04-21 19:29:05 +0000 |
| commit | 08d3a5d2feafe9d54c354028f38d7cfa4e94293c (patch) | |
| tree | d045295c3b725e42a80acb48ad4ccf566b676f4f | |
| parent | a8da122fb3c9c1f66f43da01099fb6aa86d554c6 (diff) | |
Fix null reference when request content type is application/x-www-form-urlencoded
| -rw-r--r-- | Emby.Server.Implementations/Services/ServiceHandler.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Services/ServiceHandler.cs b/Emby.Server.Implementations/Services/ServiceHandler.cs index 621be4fcb..d32fce1c7 100644 --- a/Emby.Server.Implementations/Services/ServiceHandler.cs +++ b/Emby.Server.Implementations/Services/ServiceHandler.cs @@ -26,7 +26,10 @@ namespace Emby.Server.Implementations.Services if (!string.IsNullOrEmpty(contentType) && httpReq.ContentLength > 0) { var deserializer = RequestHelper.GetRequestReader(host, contentType); - return deserializer?.Invoke(requestType, httpReq.InputStream); + if (deserializer != null) + { + return deserializer.Invoke(requestType, httpReq.InputStream); + } } return Task.FromResult(host.CreateInstance(requestType)); |
