check for null item in ReleaseManager::get()

This commit is contained in:
Dmitry Degtyarev 2020-11-03 16:17:30 +04:00
parent 88723310d1
commit e18f084bde

View File

@ -86,10 +86,15 @@ bool ReleaseManager::filterAcceptsRow(int source_row, const QModelIndex &source_
Release *ReleaseManager::get(int index) const {
QStandardItem *item = m_sourceModel->item(index);
QVariant variant = item->data();
Release *release = variant.value<Release *>();
if (item != nullptr) {
QVariant variant = item->data();
Release *release = variant.value<Release *>();
return release;
return release;
} else {
return nullptr;
}
}
void ReleaseManager::downloadMetadata() {