From 3444200bc14c9ae10fe17b63f6c8ae67e1f42d32 Mon Sep 17 00:00:00 2001 From: Date: Mon, 5 Jan 2009 18:01:37 +0000 Subject: [PATCH] * Fixed a null reference exception in ObjectManager where prim Properties was null while calling .Properties.SetFamilyProperties, and a related problem in TestClient. Also fixed a null reference exception in sculpt data for ExportCommand.cs git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2403 52acb1d6-8a22-11de-b505-999d5b087335 --- OpenMetaverse/ObjectManager.cs | 4 ++++ Programs/examples/TestClient/Commands/Prims/ExportCommand.cs | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenMetaverse/ObjectManager.cs b/OpenMetaverse/ObjectManager.cs index a598d5af..c03c0842 100644 --- a/OpenMetaverse/ObjectManager.cs +++ b/OpenMetaverse/ObjectManager.cs @@ -2233,7 +2233,11 @@ namespace OpenMetaverse lock (sim.ObjectsPrimitives.Dictionary) { if (sim.ObjectsPrimitives.Dictionary.ContainsKey(findPrim.LocalID)) + { + if (sim.ObjectsPrimitives.Dictionary[findPrim.LocalID].Properties == null) + sim.ObjectsPrimitives.Dictionary[findPrim.LocalID].Properties = new Primitive.ObjectProperties(); sim.ObjectsPrimitives.Dictionary[findPrim.LocalID].Properties.SetFamilyProperties(props); + } } } } diff --git a/Programs/examples/TestClient/Commands/Prims/ExportCommand.cs b/Programs/examples/TestClient/Commands/Prims/ExportCommand.cs index b166d3ca..04ce706f 100644 --- a/Programs/examples/TestClient/Commands/Prims/ExportCommand.cs +++ b/Programs/examples/TestClient/Commands/Prims/ExportCommand.cs @@ -131,7 +131,8 @@ namespace OpenMetaverse.TestClient } } - if (prim.Sculpt.SculptTexture != UUID.Zero && !Textures.Contains(prim.Sculpt.SculptTexture)) { + if (prim.Sculpt != null && prim.Sculpt.SculptTexture != UUID.Zero && !Textures.Contains(prim.Sculpt.SculptTexture)) + { Textures.Add(prim.Sculpt.SculptTexture); } } @@ -219,6 +220,7 @@ namespace OpenMetaverse.TestClient void Objects_OnObjectPropertiesFamily(Simulator simulator, Primitive.ObjectProperties properties, ReportType type) { + Properties = new Primitive.ObjectProperties(); Properties.SetFamilyProperties(properties); GotPermissions = true; GotPermissionsEvent.Set();