mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
Better error-handling when storing assets: recognize that 'null' is an error value
This commit is contained in:
@@ -143,7 +143,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
asset1.Data = asset.Data;
|
||||
|
||||
string id = m_scene.AssetService.Store(asset1);
|
||||
if (id == string.Empty)
|
||||
if (String.IsNullOrEmpty(id))
|
||||
{
|
||||
m_log.DebugFormat("[HG ASSET MAPPER]: Failed to post asset {0} to asset server {1}: the server did not accept the asset", asset.ID, url);
|
||||
success = false;
|
||||
|
||||
@@ -346,7 +346,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
return asset.ID;
|
||||
}
|
||||
|
||||
string id = string.Empty;
|
||||
string id;
|
||||
if (IsHG(asset.ID))
|
||||
{
|
||||
if (m_AssetPerms.AllowedExport(asset.Type))
|
||||
@@ -357,18 +357,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
else
|
||||
id = m_GridService.Store(asset);
|
||||
|
||||
if (id != String.Empty)
|
||||
{
|
||||
// Placing this here, so that this work with old asset servers that don't send any reply back
|
||||
// SynchronousRestObjectRequester returns somethins that is not an empty string
|
||||
if (id != null)
|
||||
asset.ID = id;
|
||||
if (String.IsNullOrEmpty(id))
|
||||
return string.Empty;
|
||||
|
||||
asset.ID = id;
|
||||
|
||||
if (m_Cache != null)
|
||||
m_Cache.Cache(asset);
|
||||
|
||||
if (m_Cache != null)
|
||||
m_Cache.Cache(asset);
|
||||
}
|
||||
return id;
|
||||
|
||||
}
|
||||
|
||||
public bool UpdateContent(string id, byte[] data)
|
||||
|
||||
Reference in New Issue
Block a user