- if (SSLCertificateIter->second->pCertInfo == NULL){
+ if (SSLCertificateIter == AccountCertificateData.end() || SSLCertificateIter->second->pCertInfo == NULL){
wxMessageBox("No certificate information is available due to invalid connection details, connection being in progress or invalid certificate data received.");
wxMessageBox("No certificate information is available due to invalid connection details, connection being in progress or invalid certificate data received.");