mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Check return value of 'virtual bool QFile::open(QIODeviceBase::OpenMode)'
Signed-off-by: Dylan Schooner <dschooner05@gmail.com>
This commit is contained in:
parent
2982e6e7c9
commit
8d42bdaf6b
9 changed files with 63 additions and 28 deletions
|
|
@ -112,7 +112,10 @@ auto HttpMetaCache::resolveEntry(QString base, QString resource_path, QString ex
|
|||
qint64 file_last_changed = finfo.lastModified().toUTC().toMSecsSinceEpoch();
|
||||
if (file_last_changed != entry->m_local_changed_timestamp) {
|
||||
QFile input(real_path);
|
||||
input.open(QIODevice::ReadOnly);
|
||||
if (!input.open(QIODevice::ReadOnly)) {
|
||||
qWarning() << "Failed to open file '" << input.fileName() << "' for reading!";
|
||||
return staleEntry(base, resource_path);
|
||||
}
|
||||
QString md5sum = QCryptographicHash::hash(input.readAll(), QCryptographicHash::Md5).toHex().constData();
|
||||
if (entry->m_md5sum != md5sum) {
|
||||
selected_base.entry_list.remove(resource_path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue