From c28f505caa8e686276434ca3608adf772e2b5882 Mon Sep 17 00:00:00 2001 From: MW Date: Sat, 1 Dec 2007 14:31:21 +0000 Subject: [PATCH] small bit of refactoring --- .../Environment/Modules/AvatarFactoryModule.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs index d8a90c5a7b..820a26b4c8 100644 --- a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs +++ b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs @@ -2,6 +2,7 @@ using System; using libsecondlife; using Nini.Config; using OpenSim.Framework; +using OpenSim.Framework.Communications.Cache; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; @@ -64,7 +65,16 @@ namespace OpenSim.Region.Environment.Modules // then store assetid and itemId and wearable type in a database foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) { - LLUUID assetID = m_scene.CommsManager.UserProfileCache.GetUserDetails(clientView.AgentId).RootFolder.HasItem(wear.ItemID).assetID; + LLUUID assetId; + CachedUserInfo profile = m_scene.CommsManager.UserProfileCache.GetUserDetails(clientView.AgentId); + if (profile != null) + { + InventoryItemBase baseItem = profile.RootFolder.HasItem(wear.ItemID); + if (baseItem != null) + { + assetId = baseItem.assetID; + } + } } }