aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorCharles Krinke2008-07-21 13:40:08 +0000
committerCharles Krinke2008-07-21 13:40:08 +0000
commita432a07005c700222de612f408fe2921d2348825 (patch)
tree40418a48a705124291dfbac48a12c75a30964a4e /OpenSim/Region
parent* eliminated some warnings and added some const and readonlies (diff)
downloadopensim-SC_OLD-a432a07005c700222de612f408fe2921d2348825.zip
opensim-SC_OLD-a432a07005c700222de612f408fe2921d2348825.tar.gz
opensim-SC_OLD-a432a07005c700222de612f408fe2921d2348825.tar.bz2
opensim-SC_OLD-a432a07005c700222de612f408fe2921d2348825.tar.xz
Mantis#1798. Thank you kindly, StrawberryFride for a patch that:
Fixes a couple of places where null reference exceptions were being caught and ignored rather than null checks being performed.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/SimStatsReporter.cs2
2 files changed, 5 insertions, 13 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 57d3e5c..399cbf6 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -95,22 +95,14 @@ namespace OpenSim.Region.Environment.Scenes
95 // If we're not doing the initial set 95 // If we're not doing the initial set
96 // Then we've got to remove the previous 96 // Then we've got to remove the previous
97 // event handler 97 // event handler
98 try 98
99 { 99 if (_PhyScene != null)
100 _PhyScene.OnPhysicsCrash -= physicsBasedCrash; 100 _PhyScene.OnPhysicsCrash -= physicsBasedCrash;
101 }
102 catch (NullReferenceException)
103 {
104 // This occurs when storing to _PhyScene the first time.
105 // Is there a better way to check the event handler before
106 // getting here
107 // This can be safely ignored. We're setting the first inital
108 // there are no event handler's registered.
109 }
110 101
111 _PhyScene = value; 102 _PhyScene = value;
112 103
113 _PhyScene.OnPhysicsCrash += physicsBasedCrash; 104 if (_PhyScene != null)
105 _PhyScene.OnPhysicsCrash += physicsBasedCrash;
114 } 106 }
115 } 107 }
116 108
diff --git a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
index 60b5c10..f46aba4 100644
--- a/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Environment/Scenes/SimStatsReporter.cs
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Environment.Scenes
153 try 153 try
154 { 154 {
155 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); 155 IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
156 statpack.Region.RegionFlags = estateModule.GetRegionFlags(); 156 statpack.Region.RegionFlags = estateModule != null ? estateModule.GetRegionFlags() : (uint) 0;
157 } 157 }
158 catch (Exception) 158 catch (Exception)
159 { 159 {