mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 19:36:07 +08:00
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.
This commit is contained in:
@@ -95,22 +95,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
// If we're not doing the initial set
|
||||
// Then we've got to remove the previous
|
||||
// event handler
|
||||
try
|
||||
{
|
||||
|
||||
if (_PhyScene != null)
|
||||
_PhyScene.OnPhysicsCrash -= physicsBasedCrash;
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
// This occurs when storing to _PhyScene the first time.
|
||||
// Is there a better way to check the event handler before
|
||||
// getting here
|
||||
// This can be safely ignored. We're setting the first inital
|
||||
// there are no event handler's registered.
|
||||
}
|
||||
|
||||
_PhyScene = value;
|
||||
|
||||
_PhyScene.OnPhysicsCrash += physicsBasedCrash;
|
||||
if (_PhyScene != null)
|
||||
_PhyScene.OnPhysicsCrash += physicsBasedCrash;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
try
|
||||
{
|
||||
IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>();
|
||||
statpack.Region.RegionFlags = estateModule.GetRegionFlags();
|
||||
statpack.Region.RegionFlags = estateModule != null ? estateModule.GetRegionFlags() : (uint) 0;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user