From 4cc954249daf09bd4acf6ce31dc163d83c3dde26 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 23 Mar 2016 21:03:20 +0100 Subject: Mantis 7842 - remove another possible null dereference --- .../Scripting/LoadImageURL/LoadImageURLModule.cs | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index d45962f..04536e4 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs @@ -274,27 +274,27 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL stream.Close(); if (response != null) - response.Close(); - - if ( - response.StatusCode == HttpStatusCode.MovedPermanently - || response.StatusCode == HttpStatusCode.Found - || response.StatusCode == HttpStatusCode.SeeOther - || response.StatusCode == HttpStatusCode.TemporaryRedirect) { - string redirectedUrl = response.Headers["Location"]; + if (response.StatusCode == HttpStatusCode.MovedPermanently + || response.StatusCode == HttpStatusCode.Found + || response.StatusCode == HttpStatusCode.SeeOther + || response.StatusCode == HttpStatusCode.TemporaryRedirect) + { + string redirectedUrl = response.Headers["Location"]; - MakeHttpRequest(redirectedUrl, state.RequestID); - } - else - { - m_log.DebugFormat("[LOADIMAGEURLMODULE]: Returning {0} bytes of image data for request {1}", - imageJ2000.Length, state.RequestID); + MakeHttpRequest(redirectedUrl, state.RequestID); + } + else + { + m_log.DebugFormat("[LOADIMAGEURLMODULE]: Returning {0} bytes of image data for request {1}", + imageJ2000.Length, state.RequestID); - m_textureManager.ReturnData( - state.RequestID, - new OpenSim.Region.CoreModules.Scripting.DynamicTexture.DynamicTexture( - request.RequestUri, null, imageJ2000, newSize, false)); + m_textureManager.ReturnData( + state.RequestID, + new OpenSim.Region.CoreModules.Scripting.DynamicTexture.DynamicTexture( + request.RequestUri, null, imageJ2000, newSize, false)); + } + response.Close(); } } } -- cgit v1.1