From 9cdd9e215ccb250992b82e229a9930c2648f827c Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 12 Sep 2008 21:32:45 +0000 Subject: * Patch http://opensimulator.org/mantis/view.php?id=2172 * Patch attached that adds the check for uninitialized appearance when inventory items are received and processed. Also attempts to ensure that appearance is initialized even when the profile cache has not been built. * This will not fix the race condition, but should at least remove the unhandled exception that is being reported in Mantis 0002126. * Thanks cmickeyb --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index abda63e..ff043fb 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -2911,19 +2911,33 @@ namespace OpenSim.Region.Environment.Scenes private void ItemReceived(UUID itemID) { + if (null == m_appearance) + { + m_log.Warn("[ATTACHMENT] Appearance has not been initialized"); + return; + } + int attachpoint = m_appearance.GetAttachpoint(itemID); if (attachpoint == 0) return; UUID asset = m_appearance.GetAttachedAsset(attachpoint); - if (asset == UUID.Zero) // We have just logged in + if (UUID.Zero == asset) // We have just logged in { m_log.InfoFormat("[ATTACHMENT] Rez attachment {0}", itemID.ToString()); - // Rez from inventory - m_scene.RezSingleAttachment(ControllingClient, itemID, - (uint)attachpoint, 0, 0); + try + { + // Rez from inventory + m_scene.RezSingleAttachment(ControllingClient, itemID, + (uint)attachpoint, 0, 0); + } + catch (Exception e) + { + m_log.ErrorFormat("[ATTACHMENT] Unable to rez attachment: {0}", e.ToString()); + } + return; } -- cgit v1.1