From e540b66a8660ab2f3d3a9be153e8cf8aaa641714 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Tue, 7 Apr 2009 16:53:41 +0000 Subject: From: Alan Webb Fix null reference exception during close down of IRC module if the region was not actually initialized. --- OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/OptionalModules/Avatar/Chat') diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs index 0facc14..13874fa 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCBridgeModule.cs @@ -148,8 +148,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat if (!enabled) return; + if (region == null) + return; + region.Close(); - lock (m_regions) m_regions.Remove(region); + + if(m_regions.Contains(region)) + { + lock (m_regions) m_regions.Remove(region); + } + } #endregion -- cgit v1.1