diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 5b5880486b..da76ab8075 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2382,24 +2382,23 @@ namespace OpenSim.Region.Environment.Scenes /// public void GetAvatarAppearance(IClientAPI client, out AvatarAppearance appearance) { - appearance = null; // VS needs this line, mono doesn't + appearance = new AvatarAppearance(); try { - if (m_AvatarFactory == null || - !m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) + if (m_AvatarFactory != null) { - m_log.Warn("[APPEARANCE]: Appearance not found, creating default"); - appearance = new AvatarAppearance(); + if (m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance)) + return; } } catch (Exception e) { - m_log.ErrorFormat( - "[APPERANCE]: Problem when fetching appearance for avatar {0}, {1}, using default. {2}", - client.Name, client.AgentId, e); - appearance = new AvatarAppearance(); + m_log.ErrorFormat("[APPEARANCE]: Problem fetching appearance for avatar {0}, {1}, {2}", + client.Name, client.AgentId, e.ToString()); } + m_log.Warn("[APPEARANCE]: Appearance not found, returning default"); + } /// diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index abda63e636..ff043fb28c 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; }