aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
authorMelanie2010-10-27 20:47:27 +0100
committerMelanie2010-10-27 20:47:27 +0100
commit1fcac7203d0e92f735d10c42681768521d712ea5 (patch)
treebd667928378153e68885858498ab94099e6e3706 /OpenSim/Region/Framework/Scenes/SceneGraph.cs
parentMerge branch 'master' of ssh://MyConnection01/var/git/opensim (diff)
downloadopensim-SC-1fcac7203d0e92f735d10c42681768521d712ea5.zip
opensim-SC-1fcac7203d0e92f735d10c42681768521d712ea5.tar.gz
opensim-SC-1fcac7203d0e92f735d10c42681768521d712ea5.tar.bz2
opensim-SC-1fcac7203d0e92f735d10c42681768521d712ea5.tar.xz
Prevent nullrefs in scene object deletion. Mantis #5156
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index f81c551..24d7334 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -406,11 +406,14 @@ namespace OpenSim.Region.Framework.Scenes
406 public bool DeleteSceneObject(UUID uuid, bool resultOfObjectLinked) 406 public bool DeleteSceneObject(UUID uuid, bool resultOfObjectLinked)
407 { 407 {
408 EntityBase entity; 408 EntityBase entity;
409 if (!Entities.TryGetValue(uuid, out entity) && entity is SceneObjectGroup) 409 if (!Entities.TryGetValue(uuid, out entity) || (!(entity is SceneObjectGroup)))
410 return false; 410 return false;
411 411
412 SceneObjectGroup grp = (SceneObjectGroup)entity; 412 SceneObjectGroup grp = (SceneObjectGroup)entity;
413 413
414 if (entity == null)
415 return false;
416
414 if (!resultOfObjectLinked) 417 if (!resultOfObjectLinked)
415 { 418 {
416 m_numPrim -= grp.PrimCount; 419 m_numPrim -= grp.PrimCount;