From 869b39c451ca1ce2dca4e651d6eada0c5b213f06 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 22 Apr 2007 17:31:51 +0000 Subject: [PATCH] SimClient: Added Try/Catch over block of code which is triggering an exception that should not be triggerable. (Duplicate key after dictionary is locked, checked for key, then added) [!?!?] AvatarUpdate: Added check for if the physics actor is null before attempting to access it. --- OpenSim.RegionServer/SimClient.cs | 12 +++++++++++- OpenSim.RegionServer/world/AvatarUpdate.cs | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs index e4c445bd62..d716bd6cc2 100644 --- a/OpenSim.RegionServer/SimClient.cs +++ b/OpenSim.RegionServer/SimClient.cs @@ -731,7 +731,17 @@ namespace OpenSim { if (!NeedAck.ContainsKey(Pack.Header.Sequence)) { - NeedAck.Add(Pack.Header.Sequence, Pack); + try + { + NeedAck.Add(Pack.Header.Sequence, Pack); + } + catch (Exception e) + { + // Ignore + // Seems to throw a exception here occasionally + // of 'duplicate key' despite being locked. + // !?!?!? + } } else { diff --git a/OpenSim.RegionServer/world/AvatarUpdate.cs b/OpenSim.RegionServer/world/AvatarUpdate.cs index 6c0ace774d..34d032c1d4 100644 --- a/OpenSim.RegionServer/world/AvatarUpdate.cs +++ b/OpenSim.RegionServer/world/AvatarUpdate.cs @@ -10,6 +10,12 @@ namespace OpenSim.world { public override void update() { + if (this._physActor == null) + { + //HACKHACK: Note to work out why this entity does not have a physics actor + // and prehaps create one. + return; + } libsecondlife.LLVector3 pos2 = new LLVector3(this._physActor.Position.X, this._physActor.Position.Y, this._physActor.Position.Z); if (this.updateflag) {