if Data is null, shortcut to client.SendImageNotFound, as any other

option at this point is going to give us a NullReferenceException
0.6.5-rc1
Sean Dague 2009-04-13 15:08:06 +00:00
parent 15d39f33ca
commit 532ae6d925
1 changed files with 10 additions and 3 deletions

View File

@ -147,11 +147,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
return result; return result;
} }
public bool SendFirstPacket(LLClientView client) public bool SendFirstPacket(LLClientView client)
{ {
// this means we don't have
if (Data == null)
{
client.SendImageNotFound(m_requestedUUID);
m_log.WarnFormat("[TEXTURE]: Got null Data element on a asset {0}.. and the missing image Data property is al", m_requestedUUID);
return true;
}
// Do we have less then 1 packet's worth of data? // Do we have less then 1 packet's worth of data?
if (m_asset.Data.Length <= cFirstPacketSize) else if (m_asset.Data.Length <= cFirstPacketSize)
{ {
// Send only 1 packet // Send only 1 packet
client.SendImageFirstPart(1, m_requestedUUID, (uint)m_asset.Data.Length, m_asset.Data, 2); client.SendImageFirstPart(1, m_requestedUUID, (uint)m_asset.Data.Length, m_asset.Data, 2);
@ -173,8 +180,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
} }
return false; return false;
} }
private bool SendPacket(LLClientView client) private bool SendPacket(LLClientView client)
{ {
bool complete = false; bool complete = false;