check item for null when marking read/unread/starred

This commit is contained in:
Martin Rotter 2022-01-03 08:02:55 +01:00
parent 0d046d6b20
commit af19e5376a
2 changed files with 11 additions and 3 deletions

View file

@ -26,7 +26,7 @@
<url type="donation">https://github.com/sponsors/martinrotter</url>
<content_rating type="oars-1.1" />
<releases>
<release version="4.0.4" date="2021-12-22"/>
<release version="4.0.4" date="2022-01-03"/>
</releases>
<content_rating type="oars-1.0">
<content_attribute id="violence-cartoon">none</content_attribute>

View file

@ -549,11 +549,19 @@ QList<Feed*>FeedsModel::feedsForIndex(const QModelIndex& index) const {
}
bool FeedsModel::markItemRead(RootItem* item, RootItem::ReadStatus read) {
return item->markAsReadUnread(read);
if (item != nullptr) {
return item->markAsReadUnread(read);
}
return true;
}
bool FeedsModel::markItemCleared(RootItem* item, bool clean_read_only) {
return item->cleanMessages(clean_read_only);
if (item != nullptr) {
return item->cleanMessages(clean_read_only);
}
return true;
}
QVariant FeedsModel::data(const QModelIndex& index, int role) const {