From 90f5af890253a3170dfd1f08f639d171e0e7a871 Mon Sep 17 00:00:00 2001 From: Neel Patel Date: Tue, 19 Dec 2017 12:20:01 +0000 Subject: [PATCH] Avoid a potential crash when downloading. Fixes #2964 --- runtime/BrowserWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/BrowserWindow.cpp b/runtime/BrowserWindow.cpp index 2dd5b492a..38982c70b 100644 --- a/runtime/BrowserWindow.cpp +++ b/runtime/BrowserWindow.cpp @@ -662,7 +662,7 @@ void BrowserWindow::downloadFileProgress(qint64 readData, qint64 totalData) } // Check if download is finished without readyRead signal then write the data. - if(m_reply->isFinished() && !is_readyReadSignaled) + if(m_reply && m_reply->isFinished() && !is_readyReadSignaled) { // Write data to file m_file->write(m_reply->read(readData)); @@ -691,7 +691,7 @@ void BrowserWindow::downloadFileProgress(qint64 readData, qint64 totalData) m_reply = NULL; } - if(m_reply->isFinished() && readData == totalData) + if(m_reply && m_reply->isFinished() && readData == totalData) m_readBytes = 0; } }