mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-04 12:40:56 -06:00
Avoid a potential crash when downloading. Fixes #2964
This commit is contained in:
parent
88bcd3b512
commit
90f5af8902
@ -662,7 +662,7 @@ void BrowserWindow::downloadFileProgress(qint64 readData, qint64 totalData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if download is finished without readyRead signal then write the data.
|
// 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
|
// Write data to file
|
||||||
m_file->write(m_reply->read(readData));
|
m_file->write(m_reply->read(readData));
|
||||||
@ -691,7 +691,7 @@ void BrowserWindow::downloadFileProgress(qint64 readData, qint64 totalData)
|
|||||||
m_reply = NULL;
|
m_reply = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_reply->isFinished() && readData == totalData)
|
if(m_reply && m_reply->isFinished() && readData == totalData)
|
||||||
m_readBytes = 0;
|
m_readBytes = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user