From 9f29908f669cee2a4b6e13e7bd6507e7a24c1549 Mon Sep 17 00:00:00 2001 From: dahlia Date: Wed, 24 Nov 2010 02:05:41 -0800 Subject: [PATCH] catch an exception when a mesh asset header cant be decoded --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index d770ad1aa7..3386e729d8 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -276,7 +276,7 @@ namespace OpenSim.Region.Physics.Meshing m_log.Debug("[MESH]: experimental mesh proxy generation"); - OSD meshOsd; + OSD meshOsd = null; if (primShape.SculptData.Length <= 0) { @@ -287,7 +287,14 @@ namespace OpenSim.Region.Physics.Meshing long start = 0; using (MemoryStream data = new MemoryStream(primShape.SculptData)) { - meshOsd = (OSDMap)OSDParser.DeserializeLLSDBinary(data); + try + { + meshOsd = (OSDMap)OSDParser.DeserializeLLSDBinary(data); + } + catch (Exception e) + { + m_log.Error("[MESH]: Exception deserializing mesh asset header:" + e.ToString()); + } start = data.Position; }