changeset 910:55e552b4f1b7 tony_integration

Avoid potential crash when network connection fails
author Chris Cannam
date Tue, 13 May 2014 09:50:59 +0100
parents c48b07b34cb3
children 73c2fd9a7dbe 926f33d3a8b7
files data/fileio/FileSource.cpp
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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();