diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 0b99e82b46..e9a1e03d85 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -976,9 +976,9 @@ namespace OpenSim.Framework } } - using (WebResponse resp = request.GetResponse()) + try { - try + using (WebResponse resp = request.GetResponse()) { if (resp.ContentLength > 0) { @@ -988,11 +988,11 @@ namespace OpenSim.Framework respStream.Close(); } } - catch (System.InvalidOperationException) - { - // This is what happens when there is invalid XML - m_log.WarnFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString()); - } + } + catch (System.InvalidOperationException) + { + // This is what happens when there is invalid XML + m_log.WarnFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString()); } return deserial; }