* Attempting to fix NullRef exception in inventory.
parent
2d4166fecf
commit
dd8c01d7a7
OpenSim/Framework/Communications/Capabilities
|
@ -66,7 +66,7 @@ namespace OpenSim.Framework.Communications.Capabilities
|
||||||
FieldInfo[] fields = myType.GetFields();
|
FieldInfo[] fields = myType.GetFields();
|
||||||
for (int i = 0; i < fields.Length; i++)
|
for (int i = 0; i < fields.Length; i++)
|
||||||
{
|
{
|
||||||
try
|
if (fields[i] != null && fields[i].GetValue(obj) != null)
|
||||||
{
|
{
|
||||||
object fieldValue = fields[i].GetValue(obj);
|
object fieldValue = fields[i].GetValue(obj);
|
||||||
LLSDType[] fieldAttributes =
|
LLSDType[] fieldAttributes =
|
||||||
|
@ -91,12 +91,12 @@ namespace OpenSim.Framework.Communications.Capabilities
|
||||||
// OpenMetaverse.StructuredData.LLSDParser.SerializeXmlElement(
|
// OpenMetaverse.StructuredData.LLSDParser.SerializeXmlElement(
|
||||||
// writer, OpenMetaverse.StructuredData.OSD.FromObject(fieldValue));
|
// writer, OpenMetaverse.StructuredData.OSD.FromObject(fieldValue));
|
||||||
}
|
}
|
||||||
} catch(NullReferenceException e)
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
System.Console.WriteLine("-----------NRE-------------");
|
// TODO from ADAM: There is a nullref being caused by fields[i] being null
|
||||||
System.Console.WriteLine("Type: " + fields[i].GetValue(obj).GetType().FullName);
|
// on some computers. Unsure what is causing this, but would appreciate
|
||||||
System.Console.WriteLine("-----------NRE-------------");
|
// if sdague could take a look at this.
|
||||||
throw;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writer.WriteEndElement();
|
writer.WriteEndElement();
|
||||||
|
|
Loading…
Reference in New Issue