From fb120e3e236888247e7e2ba1858878040cfa766a Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 22 May 2008 17:39:13 +0000 Subject: catch case where avatar might have been child agent --- OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Modules') diff --git a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs index 0b75e89..4b8eee7 100644 --- a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs @@ -117,11 +117,16 @@ namespace OpenSim.Region.Modules.AvatarFactory { IClientAPI clientView = (IClientAPI)sender; ScenePresence avatar = m_scene.GetScenePresence(clientView.AgentId); + if(avatar == null) { + m_log.Info("Avatar is child agent, ignoring AvatarIsWearing event"); + return; + } + CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId); AvatarAppearance avatAppearance = null; if(!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) { - m_log.Info("We didn't seem to find the appearance"); + m_log.Info("We didn't seem to find the appearance, falling back to ScenePresense"); avatAppearance = avatar.Appearance; } m_log.Info("Calling Avatar is Wearing"); -- cgit v1.1