diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs index 0e3630c..713d43a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | |||
@@ -158,9 +158,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
158 | m_currentPacket = m_stopPacket; | 158 | m_currentPacket = m_stopPacket; |
159 | return; | 159 | return; |
160 | } | 160 | } |
161 | 161 | ||
162 | if (DiscardLevel >= 0 || m_stopPacket == 0) | 162 | if (DiscardLevel >= 0 || m_stopPacket == 0) |
163 | { | 163 | { |
164 | // This shouldn't happen, but if it does, we really can't proceed | ||
165 | if (Layers == null) | ||
166 | { | ||
167 | m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer"); | ||
168 | m_currentPacket = m_stopPacket; | ||
169 | return; | ||
170 | } | ||
171 | |||
164 | int maxDiscardLevel = Math.Max(0, Layers.Length - 1); | 172 | int maxDiscardLevel = Math.Max(0, Layers.Length - 1); |
165 | 173 | ||
166 | // Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel | 174 | // Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel |