From 7ca868dca5ced00441d05a31cae83604e1b196ff Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 14 Jun 2008 20:04:48 +0000 Subject: * Fixes: 0001554: r5106 update fails to load on some regions with NullRef error on volume portion of maptile drawing routine. --- OpenSim/Region/Environment/Scenes/Scene.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index a7535e1..b6d8d0e 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1160,6 +1160,9 @@ namespace OpenSim.Region.Environment.Scenes // Loop over prim in group foreach (SceneObjectPart part in mapdot.Children.Values) { + if (part == null) + continue; + // Draw if the object is at least 1 meter wide in any direction if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f) { @@ -1168,6 +1171,23 @@ namespace OpenSim.Region.Environment.Scenes try { LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA; + + // Not sure why some of these are null, oh well. + + if (part == null) + continue; + + if (part.Shape == null) + continue; + + if (part.Shape.Textures == null) + continue; + + if (part.Shape.Textures.DefaultTexture == null) + continue; + + + int colorr = 255 - (int)(texcolor.R * 255f); int colorg = 255 - (int)(texcolor.G * 255f); int colorb = 255 - (int)(texcolor.B * 255f); -- cgit v1.1