diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 1b6a1d2e58..76dcfca726 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]