From fc41f2e461255d051958160cabad3b0edf096566 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 8 Oct 2009 07:55:06 -0700 Subject: [PATCH] Added guards against the exception reported: #2009-10-08 12:58:34,462 ERROR - OpenSim.Application [APPLICATION]: #APPLICATION EXCEPTION DETECTED: System.UnhandledExceptionEventArgs # #Exception: System.Exception: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. # at OpenSim.Region.ClientStack.LindenUDP.J2KImage.SendFirstPacket(LLClientView client) in c:\Opensim\OpenSim\Region\ClientStack\LindenUDP\J2KImage.cs:line 230 # at OpenSim.Region.ClientStack.LindenUDP.J2KImage.SendPackets(LLClientView client, Int32 maxpack) in c:\Opensim\OpenSim\Region\ClientStack\LindenUDP\J2KImage.cs:line 84 --- OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs index 2f1face8cf..5877779d2b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs @@ -74,6 +74,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP public bool SendPackets(LLClientView client, int maxpack) { + if (client == null) + return false; + if (m_currentPacket <= m_stopPacket) { int count = 0; @@ -202,6 +205,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP private bool SendFirstPacket(LLClientView client) { + if (client == null) + return false; + if (m_asset == null) { m_log.Warn("[J2KIMAGE]: Sending ImageNotInDatabase for texture " + TextureID); @@ -234,6 +240,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP private bool SendPacket(LLClientView client) { + if (client == null) + return false; + bool complete = false; int imagePacketSize = ((int)m_currentPacket == (TexturePacketCount())) ? LastPacketSize() : IMAGE_PACKET_SIZE;