Mercurial > hg > svcore
comparison data/fileio/FileSource.cpp @ 910:55e552b4f1b7 tony_integration
Avoid potential crash when network connection fails
author | Chris Cannam |
---|---|
date | Tue, 13 May 2014 09:50:59 +0100 |
parents | f5cd33909744 |
children | b9d7352336ce |
comparison
equal
deleted
inserted
replaced
909:c48b07b34cb3 | 910:55e552b4f1b7 |
---|---|
743 | 743 |
744 void | 744 void |
745 FileSource::replyFailed(QNetworkReply::NetworkError) | 745 FileSource::replyFailed(QNetworkReply::NetworkError) |
746 { | 746 { |
747 emit progress(100); | 747 emit progress(100); |
748 m_errorString = m_reply->errorString(); | 748 if (!m_reply) { |
749 cerr << "WARNING: FileSource::replyFailed() called without a reply object being known to us" << endl; | |
750 } else { | |
751 m_errorString = m_reply->errorString(); | |
752 } | |
749 m_ok = false; | 753 m_ok = false; |
750 m_done = true; | 754 m_done = true; |
751 cleanup(); | 755 cleanup(); |
752 emit ready(); | 756 emit ready(); |
753 } | 757 } |