PropagatorDownload: fix possible crash
authorOlivier Goffart <ogoffart@woboq.com>
Wed, 24 Feb 2016 18:52:14 +0000 (19:52 +0100)
committerOlivier Goffart <ogoffart@woboq.com>
Wed, 24 Feb 2016 18:52:14 +0000 (19:52 +0100)
Backtrace seen from the crash reporter where reply() is null.

src/libsync/propagatedownload.cpp

index 2b6e0140e2f02390bb0cf50ced83ca17a28f4a4e..dfc27951193237646c0bca625a6b2828313611a6 100644 (file)
@@ -286,7 +286,9 @@ void GETFileJob::slotReadyRead()
 
 void GETFileJob::slotTimeout()
 {
-    qDebug() << "Timeout" << reply()->request().url();
+    qDebug() << "Timeout" << (reply() ? reply()->request().url() : path());
+    if (!reply())
+        return;
     _errorString =  tr("Connection Timeout");
     _errorStatus = SyncFileItem::FatalError;
     reply()->abort();