diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs
index 222c873f79..613ed736a6 100644
--- a/OpenSim/Framework/InventoryItemBase.cs
+++ b/OpenSim/Framework/InventoryItemBase.cs
@@ -162,20 +162,28 @@ namespace OpenSim.Framework
///
/// The description of the inventory item (must be less than 64 characters)
///
+
public osUTF8 UTF8Description;
public string Description
+ {
+ get { return UTF8Description == null ? string.Empty : UTF8Description.ToString();}
+ set { UTF8Description = string.IsNullOrWhiteSpace(value) ? null : new osUTF8(value);}
+ }
+ /*
+ public string Description
{
get
{
- return UTF8Description.ToString();
+ return m_description;
}
set
{
- UTF8Description = new osUTF8(value);
+ m_description = value;
}
}
-
+ protected string m_description = String.Empty;
+ */
///
///
///
diff --git a/OpenSim/Framework/InventoryNodeBase.cs b/OpenSim/Framework/InventoryNodeBase.cs
index a95979762c..8d1a8942cc 100644
--- a/OpenSim/Framework/InventoryNodeBase.cs
+++ b/OpenSim/Framework/InventoryNodeBase.cs
@@ -40,11 +40,19 @@ namespace OpenSim.Framework
public virtual string Name
{
- get { return UTF8Name.ToString(); }
- set { UTF8Name = new osUTF8(value); }
+ get { return UTF8Name == null ? string.Empty : UTF8Name.ToString(); }
+ set { UTF8Name = string.IsNullOrEmpty(value) ? null : new osUTF8(value); }
}
public osUTF8 UTF8Name;
+ /*
+ public virtual string Name
+ {
+ get { return m_name; }
+ set { m_name = value; }
+ }
+ private string m_name = string.Empty;
+ */
///
/// A UUID containing the ID for the inventory node itself
///
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
index accbfe7b49..5ba7e78089 100644
--- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
+++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs
@@ -868,7 +868,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- private int getxmlNode(ref osUTF8Slice data, out osUTF8Slice h)
+ private int getxmlNode(osUTF8Slice data, out osUTF8Slice h)
{
h = data;
int st = -1;
@@ -898,10 +898,10 @@ namespace OpenSim.Region.Framework.Scenes
return ed;
}
- private bool TryGetxmlUUIDValue(ref osUTF8Slice data, out UUID id)
+ private bool TryGetxmlUUIDValue(osUTF8Slice data, out UUID id)
{
id = UUID.Zero;
- if(getxmlNode(ref data, out osUTF8Slice h) < 0)
+ if(getxmlNode(data, out osUTF8Slice h) < 0)
return false;
if (h.StartsWith(UUIDB))
@@ -935,7 +935,7 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
- private bool TryGetXMLBinary(ref osUTF8Slice data, out byte[] te)
+ private bool TryGetXMLBinary(osUTF8Slice data, out byte[] te)
{
te = null;
int indx = data.IndexOf((byte)'<');
@@ -987,7 +987,7 @@ namespace OpenSim.Region.Framework.Scenes
int next;
osUTF8Slice nodeName;
- while ((next = getxmlNode(ref data, out nodeName)) > 0)
+ while ((next = getxmlNode(data, out nodeName)) > 0)
{
if (nodeName.StartsWith((byte)'/'))
continue;
@@ -996,7 +996,7 @@ namespace OpenSim.Region.Framework.Scenes
if (nodeName.EndsWith((byte)'/'))
continue;
- if (TryGetXMLBinary(ref data, out byte[] abytes) && abytes != null && abytes.Length > 16)
+ if (TryGetXMLBinary(data, out byte[] abytes) && abytes != null && abytes.Length > 16)
{
try
{
@@ -1028,21 +1028,21 @@ namespace OpenSim.Region.Framework.Scenes
{
if (!nodeName.EndsWith((byte)'d'))
continue;
- if (TryGetxmlUUIDValue(ref data, out UUID id) && id != UUID.Zero)
+ if (TryGetxmlUUIDValue(data, out UUID id) && id != UUID.Zero)
GatheredUuids[id] = (sbyte)AssetType.Sound;
}
else if (nodeName.StartsWith(SoundIDB))
{
if (nodeName.EndsWith((byte)'/'))
continue;
- if (TryGetxmlUUIDValue(ref data, out UUID id) && id != UUID.Zero)
+ if (TryGetxmlUUIDValue(data, out UUID id) && id != UUID.Zero)
GatheredUuids[id] = (sbyte)AssetType.Sound;
}
else if (nodeName.StartsWith(SculptTextureB))
{
if (nodeName.EndsWith((byte)'/'))
continue;
- if (TryGetxmlUUIDValue(ref data, out UUID id) && id != UUID.Zero)
+ if (TryGetxmlUUIDValue(data, out UUID id) && id != UUID.Zero)
GatheredUuids[id] = (sbyte)AssetType.Texture; // can be mesh but no prob
}
else if (nodeName.StartsWith(ExtraParamsB))
@@ -1050,7 +1050,7 @@ namespace OpenSim.Region.Framework.Scenes
if (nodeName.EndsWith((byte)'/'))
continue;
- if (TryGetXMLBinary(ref data, out byte[] exbytes) && exbytes != null && exbytes.Length > 16)
+ if (TryGetXMLBinary(data, out byte[] exbytes) && exbytes != null && exbytes.Length > 16)
{
try
{
@@ -1083,7 +1083,7 @@ namespace OpenSim.Region.Framework.Scenes
if (nodeName.EndsWith((byte)'/'))
continue;
- if (TryGetXMLBinary(ref data, out byte[] psbytes) && psbytes != null && psbytes.Length > 16)
+ if (TryGetXMLBinary(data, out byte[] psbytes) && psbytes != null && psbytes.Length > 16)
{
try
{
@@ -1105,7 +1105,7 @@ namespace OpenSim.Region.Framework.Scenes
if (nodeName.EndsWith((byte)'/'))
continue;
- if (TryGetXMLBinary(ref data, out byte[] tebytes) && tebytes != null && tebytes.Length > 16)
+ if (TryGetXMLBinary(data, out byte[] tebytes) && tebytes != null && tebytes.Length > 16)
{
try
{
@@ -1135,11 +1135,11 @@ namespace OpenSim.Region.Framework.Scenes
{
if (nodeName.EndsWith((byte)'/'))
continue;
- while ((next = getxmlNode(ref data, out nodeName)) > 0)
+ while ((next = getxmlNode(data, out nodeName)) > 0)
{
if (nodeName.StartsWith(AssetIDB))
{
- if (TryGetxmlUUIDValue(ref data, out UUID id) && id != UUID.Zero)
+ if (TryGetxmlUUIDValue(data, out UUID id) && id != UUID.Zero)
AddForInspection(id);
}
else if (nodeName.StartsWith(endTaskInventoryB))
@@ -1217,7 +1217,7 @@ namespace OpenSim.Region.Framework.Scenes
{
osUTF8Slice data = new osUTF8Slice(materialAsset.Data);
int next;
- while ((next = getxmlNode(ref data, out osUTF8Slice header)) > 0)
+ while ((next = getxmlNode(data, out osUTF8Slice header)) > 0)
{
if (header.StartsWith((byte)'/'))
continue;