diff --git a/src/System.ServiceModel.Http/src/System/ServiceModel/Channels/HttpResponseMessageHelper.cs b/src/System.ServiceModel.Http/src/System/ServiceModel/Channels/HttpResponseMessageHelper.cs index 3613b0045ee..3c292bad425 100644 --- a/src/System.ServiceModel.Http/src/System/ServiceModel/Channels/HttpResponseMessageHelper.cs +++ b/src/System.ServiceModel.Http/src/System/ServiceModel/Channels/HttpResponseMessageHelper.cs @@ -297,7 +297,10 @@ private async Task DecodeBufferedMessageAsync(ArraySegment buffer } finally { - inputStream.Dispose(); + if (inputStream != null) + { + inputStream.Dispose(); + } } }