diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d00c9905ef..5e5a52e981 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2467,7 +2467,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); vialogin = true; IUserAgentVerificationModule userVerification = RequestModuleInterface(); - if (userVerification != null) + if (userVerification != null && ep != null) { if (!userVerification.VerifyClient(aCircuit, ep.ToString())) { @@ -2491,22 +2491,15 @@ namespace OpenSim.Region.Framework.Scenes } m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); - /* - string logMsg = string.Format("[SCENE]: Adding new {0} agent for {1} in {2}", - ((aCircuit.child == true) ? "child" : "root"), client.Name, - RegionInfo.RegionName); - m_log.Debug(logMsg); - */ - - //CommsManager.UserProfileCacheService.AddNewUser(client.AgentId); ScenePresence sp = CreateAndAddScenePresence(client); - sp.Appearance = aCircuit.Appearance; + if (aCircuit != null) + sp.Appearance = aCircuit.Appearance; // HERE!!! Do the initial attachments right here // first agent upon login is a root agent by design. // All other AddNewClient calls find aCircuit.child to be true - if (aCircuit == null || aCircuit.child == false) + if (aCircuit == null || (aCircuit != null && aCircuit.child == false)) { sp.IsChildAgent = false; Util.FireAndForget(delegate(object o) { sp.RezAttachments(); }); diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index b775d27fd1..b50d4ca5b2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs @@ -94,16 +94,24 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; sogd.Enabled = false; - + SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene); - - IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId); - scene.DeRezObject(client, part.LocalId, UUID.Zero, DeRezAction.Delete, UUID.Zero); - + + try + { + IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId); + scene.DeRezObject(client, part.LocalId, UUID.Zero, DeRezAction.Delete, UUID.Zero); + } + catch (Exception e) + { + Console.WriteLine("Exception: " + e.StackTrace); + } SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); + Assert.That(retrievedPart, Is.Not.Null); sogd.InventoryDeQueueAndDelete(); + SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId); Assert.That(retrievedPart2, Is.Null); }