diff options
author | Sean Dague | 2009-04-13 15:08:06 +0000 |
---|---|---|
committer | Sean Dague | 2009-04-13 15:08:06 +0000 |
commit | 532ae6d925e6111b5a1d24d19f752e3f22cf6445 (patch) | |
tree | 75122db6929e81b130750b53809c19f745de4391 | |
parent | scream out a bit warning if we failed to set default image (diff) | |
download | opensim-SC-532ae6d925e6111b5a1d24d19f752e3f22cf6445.zip opensim-SC-532ae6d925e6111b5a1d24d19f752e3f22cf6445.tar.gz opensim-SC-532ae6d925e6111b5a1d24d19f752e3f22cf6445.tar.bz2 opensim-SC-532ae6d925e6111b5a1d24d19f752e3f22cf6445.tar.xz |
if Data is null, shortcut to client.SendImageNotFound, as any other
option at this point is going to give us a NullReferenceException
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs index 54be807..acb8497 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | |||
@@ -147,11 +147,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
147 | } | 147 | } |
148 | return result; | 148 | return result; |
149 | } | 149 | } |
150 | |||
150 | public bool SendFirstPacket(LLClientView client) | 151 | public bool SendFirstPacket(LLClientView client) |
151 | { | 152 | { |
152 | 153 | // this means we don't have | |
154 | if (Data == null) | ||
155 | { | ||
156 | client.SendImageNotFound(m_requestedUUID); | ||
157 | m_log.WarnFormat("[TEXTURE]: Got null Data element on a asset {0}.. and the missing image Data property is al", m_requestedUUID); | ||
158 | return true; | ||
159 | } | ||
153 | // Do we have less then 1 packet's worth of data? | 160 | // Do we have less then 1 packet's worth of data? |
154 | if (m_asset.Data.Length <= cFirstPacketSize) | 161 | else if (m_asset.Data.Length <= cFirstPacketSize) |
155 | { | 162 | { |
156 | // Send only 1 packet | 163 | // Send only 1 packet |
157 | client.SendImageFirstPart(1, m_requestedUUID, (uint)m_asset.Data.Length, m_asset.Data, 2); | 164 | client.SendImageFirstPart(1, m_requestedUUID, (uint)m_asset.Data.Length, m_asset.Data, 2); |
@@ -173,8 +180,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
173 | } | 180 | } |
174 | } | 181 | } |
175 | return false; | 182 | return false; |
176 | |||
177 | } | 183 | } |
184 | |||
178 | private bool SendPacket(LLClientView client) | 185 | private bool SendPacket(LLClientView client) |
179 | { | 186 | { |
180 | bool complete = false; | 187 | bool complete = false; |