Skip to content

Commit

Permalink
Check for null pointer
Browse files Browse the repository at this point in the history
Sometimes the application crashes with a segmentation fault due to
dereferencing a null pointer in this function
  • Loading branch information
JerzyEx committed Sep 28, 2024
1 parent 32131be commit a665858
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Classes/ListModels/releaseserieslistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ QVariant ReleaseSeriesListModel::data(const QModelIndex &index, int role) const
if (!index.isValid()) return QVariant();

auto release = m_releases->at(index.row());

if(!release)
return QVariant();
switch (role) {
case IndexRole: {
return QVariant(release->id());
Expand Down

0 comments on commit a665858

Please sign in to comment.