diff --git a/src/ExternalConnector.cpp b/src/ExternalConnector.cpp index 7a9766e78e..5374f30d21 100644 --- a/src/ExternalConnector.cpp +++ b/src/ExternalConnector.cpp @@ -244,7 +244,7 @@ char *command_completion(const char *text, int state) } wxString test(wxString(text, *wxConvCurrent).Lower()); - while (nextCommand != curCommands->end()) { + while (curCommands && (nextCommand != curCommands->end())) { wxString curTest = (*nextCommand)->GetCommand(); ++nextCommand; if (curTest.Lower().StartsWith(test)) { diff --git a/src/KnownFile.cpp b/src/KnownFile.cpp index 576330060d..bec98ef7b4 100644 --- a/src/KnownFile.cpp +++ b/src/KnownFile.cpp @@ -1153,7 +1153,7 @@ void CKnownFile::CreateOfferedFilePacket( tags.push_back(new CTagInt32(FT_FILESIZE_HI, (uint32)(GetFileSize() >> 32))); } } else { - if (!pClient->SupportsLargeFiles()) { + if (pClient && (!pClient->SupportsLargeFiles())) { wxFAIL; tags.push_back(new CTagInt32(FT_FILESIZE, 0)); } else { diff --git a/src/SharedFileList.cpp b/src/SharedFileList.cpp index 97a8eec03e..be0bdf3b08 100644 --- a/src/SharedFileList.cpp +++ b/src/SharedFileList.cpp @@ -745,7 +745,7 @@ void CSharedFileList::SendListToServer(){ // - this function is called once when connecting to a server and when a file becomes shareable - so, it's called rarely. // - if the compressed size is still >= the original size, we send the uncompressed packet // therefor we always try to compress the packet - if (server->GetTCPFlags() & SRV_TCPFLG_COMPRESSION){ + if (server && (server->GetTCPFlags() & SRV_TCPFLG_COMPRESSION)){ packet->PackPacket(); }