diff 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
line wrap: on
line diff
--- a/data/fileio/FileSource.cpp	Wed May 07 16:51:04 2014 +0100
+++ b/data/fileio/FileSource.cpp	Tue May 13 09:50:59 2014 +0100
@@ -745,7 +745,11 @@
 FileSource::replyFailed(QNetworkReply::NetworkError)
 {
     emit progress(100);
-    m_errorString = m_reply->errorString();
+    if (!m_reply) {
+        cerr << "WARNING: FileSource::replyFailed() called without a reply object being known to us" << endl;
+    } else {
+        m_errorString = m_reply->errorString();
+    }
     m_ok = false;
     m_done = true;
     cleanup();