diff options
author | Melanie Thielker | 2016-03-03 17:08:56 +0100 |
---|---|---|
committer | Melanie Thielker | 2016-03-03 17:08:56 +0100 |
commit | c541b5cf43f9853774af150b7e608e51846b423c (patch) | |
tree | 0a799288dace45a0ddb6b7c932fa0dcea1abbd71 /OpenSim/Region/CoreModules/Scripting | |
parent | Pushed AssemblyVersion up to VersionInfo, so that we don't need to do global ... (diff) | |
download | opensim-SC_OLD-c541b5cf43f9853774af150b7e608e51846b423c.zip opensim-SC_OLD-c541b5cf43f9853774af150b7e608e51846b423c.tar.gz opensim-SC_OLD-c541b5cf43f9853774af150b7e608e51846b423c.tar.bz2 opensim-SC_OLD-c541b5cf43f9853774af150b7e608e51846b423c.tar.xz |
Mantis 7833: Fix a condition where email sent from an object that is in
the process of being removed can cause a null reference
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs index 4e7ad75..0752ae5 100644 --- a/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/EMailModules/EmailModule.cs | |||
@@ -224,8 +224,9 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
224 | return null; | 224 | return null; |
225 | } | 225 | } |
226 | 226 | ||
227 | private void resolveNamePositionRegionName(UUID objectID, out string ObjectName, out string ObjectAbsolutePosition, out string ObjectRegionName) | 227 | private bool resolveNamePositionRegionName(UUID objectID, out string ObjectName, out string ObjectAbsolutePosition, out string ObjectRegionName) |
228 | { | 228 | { |
229 | ObjectName = ObjectAbsolutePosition = ObjectRegionName = String.Empty; | ||
229 | string m_ObjectRegionName; | 230 | string m_ObjectRegionName; |
230 | int objectLocX; | 231 | int objectLocX; |
231 | int objectLocY; | 232 | int objectLocY; |
@@ -239,15 +240,9 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
239 | ObjectAbsolutePosition = "(" + objectLocX + ", " + objectLocY + ", " + objectLocZ + ")"; | 240 | ObjectAbsolutePosition = "(" + objectLocX + ", " + objectLocY + ", " + objectLocZ + ")"; |
240 | ObjectName = part.Name; | 241 | ObjectName = part.Name; |
241 | ObjectRegionName = m_ObjectRegionName; | 242 | ObjectRegionName = m_ObjectRegionName; |
242 | return; | 243 | return true; |
243 | } | 244 | } |
244 | objectLocX = (int)part.AbsolutePosition.X; | 245 | return false; |
245 | objectLocY = (int)part.AbsolutePosition.Y; | ||
246 | objectLocZ = (int)part.AbsolutePosition.Z; | ||
247 | ObjectAbsolutePosition = "(" + objectLocX + ", " + objectLocY + ", " + objectLocZ + ")"; | ||
248 | ObjectName = part.Name; | ||
249 | ObjectRegionName = m_ObjectRegionName; | ||
250 | return; | ||
251 | } | 246 | } |
252 | 247 | ||
253 | /// <summary> | 248 | /// <summary> |
@@ -286,7 +281,8 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
286 | string LastObjectPosition = string.Empty; | 281 | string LastObjectPosition = string.Empty; |
287 | string LastObjectRegionName = string.Empty; | 282 | string LastObjectRegionName = string.Empty; |
288 | 283 | ||
289 | resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); | 284 | if (!resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName)) |
285 | return; | ||
290 | 286 | ||
291 | if (!address.EndsWith(m_InterObjectHostname)) | 287 | if (!address.EndsWith(m_InterObjectHostname)) |
292 | { | 288 | { |
@@ -302,7 +298,8 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules | |||
302 | //Subject | 298 | //Subject |
303 | emailMessage.Subject = subject; | 299 | emailMessage.Subject = subject; |
304 | //TEXT Body | 300 | //TEXT Body |
305 | resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName); | 301 | if (!resolveNamePositionRegionName(objectID, out LastObjectName, out LastObjectPosition, out LastObjectRegionName)) |
302 | return; | ||
306 | emailMessage.BodyText = "Object-Name: " + LastObjectName + | 303 | emailMessage.BodyText = "Object-Name: " + LastObjectName + |
307 | "\nRegion: " + LastObjectRegionName + "\nLocal-Position: " + | 304 | "\nRegion: " + LastObjectRegionName + "\nLocal-Position: " + |
308 | LastObjectPosition + "\n\n" + body; | 305 | LastObjectPosition + "\n\n" + body; |