avoid potencial null refs

0.9.1.0-post-fixes
UbitUmarov 2018-08-26 08:40:35 +01:00
parent 7c60e83f30
commit 9f3c803552
1 changed files with 4 additions and 4 deletions

View File

@ -637,11 +637,11 @@ namespace OpenSim.Framework.Servers.HttpServer
{
try
{
if(request.InputStream != null && request.InputStream.CanRead)
request.InputStream.Close();
byte[] buffer500 = SendHTML500(response);
response.OutputStream.Write(buffer500, 0, buffer500.Length);
response.Send();
if(request.InputStream.CanRead)
request.InputStream.Close();
}
catch
{
@ -829,7 +829,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
if(request.InputStream.CanRead)
if(request.InputStream != null && request.InputStream.CanRead)
request.InputStream.Dispose();
if (buffer != null)
@ -894,7 +894,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
finally
{
if(request.InputStream.CanRead)
if(request.InputStream != null && request.InputStream.CanRead)
request.InputStream.Close();
// Every month or so this will wrap and give bad numbers, not really a problem