diff options
author | UbitUmarov | 2016-09-21 22:51:25 +0100 |
---|---|---|
committer | UbitUmarov | 2016-09-21 22:51:25 +0100 |
commit | bf17da3d6182e7b5621318a220aa229036db98a1 (patch) | |
tree | 911e8128e3e7097640bc03392e9cdef60b793858 /OpenSim | |
parent | avoid a null ref (diff) | |
download | opensim-SC_OLD-bf17da3d6182e7b5621318a220aa229036db98a1.zip opensim-SC_OLD-bf17da3d6182e7b5621318a220aa229036db98a1.tar.gz opensim-SC_OLD-bf17da3d6182e7b5621318a220aa229036db98a1.tar.bz2 opensim-SC_OLD-bf17da3d6182e7b5621318a220aa229036db98a1.tar.xz |
check for null target, minor cleanup
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs index 483c25f..e314730 100644 --- a/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/WorldComm/WorldCommModule.cs | |||
@@ -374,9 +374,11 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
374 | if (channel == DEBUG_CHANNEL) | 374 | if (channel == DEBUG_CHANNEL) |
375 | return; | 375 | return; |
376 | 376 | ||
377 | // Is id an avatar? | 377 | if(target == UUID.Zero) |
378 | ScenePresence sp = m_scene.GetScenePresence(target); | 378 | return; |
379 | 379 | ||
380 | // Is target an avatar? | ||
381 | ScenePresence sp = m_scene.GetScenePresence(target); | ||
380 | if (sp != null) | 382 | if (sp != null) |
381 | { | 383 | { |
382 | // Send message to avatar | 384 | // Send message to avatar |
@@ -407,13 +409,13 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
407 | // Need to check each attachment | 409 | // Need to check each attachment |
408 | foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) | 410 | foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) |
409 | { | 411 | { |
410 | if (li.GetHostID().Equals(id)) | 412 | UUID liHostID = li.GetHostID(); |
413 | if (liHostID.Equals(id)) | ||
411 | continue; | 414 | continue; |
412 | 415 | if (m_scene.GetSceneObjectPart(liHostID) == null) | |
413 | if (m_scene.GetSceneObjectPart(li.GetHostID()) == null) | ||
414 | continue; | 416 | continue; |
415 | 417 | ||
416 | if (targets.Contains(li.GetHostID())) | 418 | if (targets.Contains(liHostID)) |
417 | QueueMessage(new ListenerInfo(li, name, id, msg)); | 419 | QueueMessage(new ListenerInfo(li, name, id, msg)); |
418 | } | 420 | } |
419 | 421 | ||
@@ -426,16 +428,15 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm | |||
426 | 428 | ||
427 | foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) | 429 | foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg)) |
428 | { | 430 | { |
431 | UUID liHostID = li.GetHostID(); | ||
429 | // Dont process if this message is from yourself! | 432 | // Dont process if this message is from yourself! |
430 | if (li.GetHostID().Equals(id)) | 433 | if (liHostID.Equals(id)) |
431 | continue; | 434 | continue; |
432 | 435 | ||
433 | SceneObjectPart sPart = m_scene.GetSceneObjectPart( | 436 | if (m_scene.GetSceneObjectPart(liHostID) == null) |
434 | li.GetHostID()); | ||
435 | if (sPart == null) | ||
436 | continue; | 437 | continue; |
437 | 438 | ||
438 | if (li.GetHostID().Equals(target)) | 439 | if (liHostID.Equals(target)) |
439 | { | 440 | { |
440 | QueueMessage(new ListenerInfo(li, name, id, msg)); | 441 | QueueMessage(new ListenerInfo(li, name, id, msg)); |
441 | break; | 442 | break; |