File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,10 @@ void CUser::SendCompressingPacket(const char* pData, int len)
285285
286286void CUser::RegionPacketAdd (char * pBuf, int len)
287287{
288+ assert (_regionBuffer != nullptr );
289+ if (_regionBuffer == nullptr )
290+ return ;
291+
288292 std::lock_guard<std::recursive_mutex> lock (g_region_mutex);
289293
290294 SetShort (_regionBuffer->pDataBuff , len, _regionBuffer->iLength );
@@ -294,14 +298,14 @@ void CUser::RegionPacketAdd(char* pBuf, int len)
294298int CUser::RegionPacketClear (char * GetBuf)
295299{
296300 int index = 0 ;
297- SetByte (GetBuf, WIZ_CONTINOUS_PACKET, index);
298301
299302 {
300303 std::lock_guard<std::recursive_mutex> lock (g_region_mutex);
301304
302- if (_regionBuffer->iLength <= 0 )
305+ if (_regionBuffer == nullptr || _regionBuffer ->iLength <= 0 )
303306 return 0 ;
304307
308+ SetByte (GetBuf, WIZ_CONTINOUS_PACKET, index);
305309 SetShort (GetBuf, _regionBuffer->iLength , index);
306310 SetString (GetBuf, _regionBuffer->pDataBuff , _regionBuffer->iLength , index);
307311
You can’t perform that action at this time.
0 commit comments