diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs index 006b730074..7312bc39a8 100644 --- a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs +++ b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs @@ -532,7 +532,7 @@ namespace OpenSim.Region.OptionalModules.Materials lock(m_Materials) { - if(oldid != UUID.Zero) + if(oldid != UUID.Zero && m_MaterialsRefCount.ContainsKey(oldid)) { m_MaterialsRefCount[oldid]--; if(m_MaterialsRefCount[oldid] <= 0)