diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs index 9cccf6636d..1c947dc6b6 100644 --- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs +++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs @@ -63,6 +63,9 @@ namespace OpenSim.Framework.Communications.Cache Stream s = rc.Request(); + if (s == null) + return null; + if (s.Length > 0) { XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs index b71a590a53..7d4518614c 100644 --- a/OpenSim/Framework/Communications/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient.cs @@ -286,7 +286,18 @@ namespace OpenSim.Framework.Communications _asyncException = null; // IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request); - _response = (HttpWebResponse) _request.GetResponse(); + try + { + _response = (HttpWebResponse) _request.GetResponse(); + } + catch (System.Net.WebException e) + { + m_log.ErrorFormat("[ASSET] Error fetching asset from asset server"); + m_log.Debug(e.ToString()); + + return null; + } + Stream src = _response.GetResponseStream(); int length = src.Read(_readbuf, 0, BufferSize); while (length > 0)