Fix crash on multi-selection download/delete action

Solves #16
This commit is contained in:
Bart De Vries 2021-09-23 13:17:06 +02:00
parent bd1cf2c5f0
commit 8900186990
1 changed files with 6 additions and 2 deletions

View File

@ -621,7 +621,9 @@ void DataManager::bulkDownloadEnclosures(QStringList list)
{
bulkQueueStatus(true, list);
for (QString id : list) {
getEntry(id)->enclosure()->download();
if (getEntry(id)->hasEnclosure()) {
getEntry(id)->enclosure()->download();
}
}
}
@ -634,7 +636,9 @@ void DataManager::bulkDeleteEnclosures(QStringList list)
{
Database::instance().execute(QStringLiteral("BEGIN TRANSACTION;"));
for (QString id : list) {
getEntry(id)->enclosure()->deleteFile();
if (getEntry(id)->hasEnclosure()) {
getEntry(id)->enclosure()->deleteFile();
}
}
Database::instance().execute(QStringLiteral("COMMIT;"));
}