mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Prevent checking file hash with an empty path
A warning is issued from Qt when the path is empty. This happens most often during test runs, but can also occur when closing a database before everything gets cleaned up.
This commit is contained in:
parent
6c02c74539
commit
8bc76a2a88
@ -131,7 +131,7 @@ void FileWatcher::checkFileChanged()
|
|||||||
QByteArray FileWatcher::calculateChecksum()
|
QByteArray FileWatcher::calculateChecksum()
|
||||||
{
|
{
|
||||||
QFile file(m_filePath);
|
QFile file(m_filePath);
|
||||||
if (file.open(QFile::ReadOnly)) {
|
if (!m_filePath.isEmpty() && file.open(QFile::ReadOnly)) {
|
||||||
QCryptographicHash hash(QCryptographicHash::Sha256);
|
QCryptographicHash hash(QCryptographicHash::Sha256);
|
||||||
if (m_fileChecksumSizeBytes > 0) {
|
if (m_fileChecksumSizeBytes > 0) {
|
||||||
hash.addData(file.read(m_fileChecksumSizeBytes));
|
hash.addData(file.read(m_fileChecksumSizeBytes));
|
||||||
|
Loading…
Reference in New Issue
Block a user