From afef1ac191d32e9c1514c294b17e404b1d4ae217 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 5 Nov 2009 13:10:58 -0800 Subject: Changing the AssetBase constructors to avoid initializing assets with an unknown asset type, and log an error if it ever does happen --- OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs') diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs index f862af1..66572d5 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAssetServices.cs @@ -261,11 +261,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory modified = (asset != null); created = !modified; - asset = new AssetBase(); - asset.FullID = uuid; - asset.Name = xml.GetAttribute("name"); + asset = new AssetBase(uuid, xml.GetAttribute("name"), SByte.Parse(xml.GetAttribute("type"))); asset.Description = xml.GetAttribute("desc"); - asset.Type = SByte.Parse(xml.GetAttribute("type")); asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0; asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); @@ -341,11 +338,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory modified = (asset != null); created = !modified; - asset = new AssetBase(); - asset.FullID = uuid; - asset.Name = xml.GetAttribute("name"); + asset = new AssetBase(uuid, xml.GetAttribute("name"), SByte.Parse(xml.GetAttribute("type"))); asset.Description = xml.GetAttribute("desc"); - asset.Type = SByte.Parse(xml.GetAttribute("type")); asset.Local = Int32.Parse(xml.GetAttribute("local")) != 0; asset.Temporary = Int32.Parse(xml.GetAttribute("temporary")) != 0; asset.Data = Convert.FromBase64String(xml.ReadElementContentAsString("Asset", "")); -- cgit v1.1