From 40324553322d1cf211eec32041bad5a2dc197f6d Mon Sep 17 00:00:00 2001 From: dahlia Date: Mon, 7 May 2012 00:33:50 -0700 Subject: add a null check for Primitive.Sculpt in PrimitiveBaseShape constructor for OpenMetaverse.Primitive object --- OpenSim/Framework/PrimitiveBaseShape.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 1b6a1d2..76dcfca 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -241,10 +241,14 @@ namespace OpenSim.Framework m_textureEntry = prim.Textures.GetBytes(); - SculptEntry = (prim.Sculpt.Type != OpenMetaverse.SculptType.None); - SculptData = prim.Sculpt.GetBytes(); - SculptTexture = prim.Sculpt.SculptTexture; - SculptType = (byte)prim.Sculpt.Type; + if (prim.Sculpt != null) + { + SculptEntry = (prim.Sculpt.Type != OpenMetaverse.SculptType.None); + SculptData = prim.Sculpt.GetBytes(); + SculptTexture = prim.Sculpt.SculptTexture; + SculptType = (byte)prim.Sculpt.Type; + } + else SculptType = (byte)OpenMetaverse.SculptType.None; } [XmlIgnore] -- cgit v1.1