From b4dcdffb5094c488a98acbe675b333c3bd4cc570 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 16 Mar 2010 11:50:22 -0700 Subject: Fixed several unhandled exceptions and performance issues with PrimitiveBaseShape.Textures. This really should be moved from a property to a method if it is going to decode a byte[] into a TextureEntry each time --- OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/UuidGatherer.cs') diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 4a1f648..0ec3cc3 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -129,19 +129,20 @@ namespace OpenSim.Region.Framework.Scenes try { Primitive.TextureEntry textureEntry = part.Shape.Textures; - - // Get the prim's default texture. This will be used for faces which don't have their own texture - assetUuids[textureEntry.DefaultTexture.TextureID] = AssetType.Texture; - - // XXX: Not a great way to iterate through face textures, but there's no - // other method available to tell how many faces there actually are - //int i = 0; - foreach (Primitive.TextureEntryFace texture in textureEntry.FaceTextures) + if (textureEntry != null) { - if (texture != null) + // Get the prim's default texture. This will be used for faces which don't have their own texture + if (textureEntry.DefaultTexture != null) + assetUuids[textureEntry.DefaultTexture.TextureID] = AssetType.Texture; + + if (textureEntry.FaceTextures != null) { - //m_log.DebugFormat("[ARCHIVER]: Got face {0}", i++); - assetUuids[texture.TextureID] = AssetType.Texture; + // Loop through the rest of the texture faces (a non-null face means the face is different from DefaultTexture) + foreach (Primitive.TextureEntryFace texture in textureEntry.FaceTextures) + { + if (texture != null) + assetUuids[texture.TextureID] = AssetType.Texture; + } } } -- cgit v1.1