* Properly guard against the possibility that CopyInventoryItem doesn't get an asset back from the cache

ThreadPoolClientBranch
Justin Clarke Casey 2008-02-20 23:31:33 +00:00
parent b0c5ef0b68
commit 0eeb56c61d
1 changed files with 16 additions and 5 deletions

View File

@ -316,12 +316,23 @@ namespace OpenSim.Region.Environment.Scenes
return; return;
} }
} }
AssetBase asset
= AssetCache.GetAsset(
item.assetID, (item.assetType == (int)AssetType.Texture ? true : false));
// TODO: preserve current permissions? if (asset != null)
CreateNewInventoryItem( {
remoteClient, newFolderID, callbackID, // TODO: preserve current permissions?
AssetCache.GetAsset(item.assetID, (item.assetType == (int)AssetType.Texture ? true : false)), CreateNewInventoryItem(
item.inventoryNextPermissions); remoteClient, newFolderID, callbackID, asset, item.inventoryNextPermissions);
}
else
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Could not copy item {0} since asset {1} could not be found",
item.inventoryName, item.assetID);
}
} }
private AssetBase CreateAsset(string name, string description, sbyte invType, sbyte assetType, byte[] data) private AssetBase CreateAsset(string name, string description, sbyte invType, sbyte assetType, byte[] data)