From dd8c01d7a730e99a2c454848a476b27640a48e3f Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 10 May 2009 21:00:07 +0000 Subject: [PATCH] * Attempting to fix NullRef exception in inventory. --- .../Communications/Capabilities/LLSDHelpers.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs index ca68e85130..ba82c75b77 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs @@ -66,7 +66,7 @@ namespace OpenSim.Framework.Communications.Capabilities FieldInfo[] fields = myType.GetFields(); for (int i = 0; i < fields.Length; i++) { - try + if (fields[i] != null && fields[i].GetValue(obj) != null) { object fieldValue = fields[i].GetValue(obj); LLSDType[] fieldAttributes = @@ -91,12 +91,12 @@ namespace OpenSim.Framework.Communications.Capabilities // OpenMetaverse.StructuredData.LLSDParser.SerializeXmlElement( // writer, OpenMetaverse.StructuredData.OSD.FromObject(fieldValue)); } - } catch(NullReferenceException e) + } + else { - System.Console.WriteLine("-----------NRE-------------"); - System.Console.WriteLine("Type: " + fields[i].GetValue(obj).GetType().FullName); - System.Console.WriteLine("-----------NRE-------------"); - throw; + // TODO from ADAM: There is a nullref being caused by fields[i] being null + // on some computers. Unsure what is causing this, but would appreciate + // if sdague could take a look at this. } } writer.WriteEndElement();