Skip to content

Commit

Permalink
Qt: Fix crash when players column is visible
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Oct 14, 2024
1 parent 11c2122 commit 2604df5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/duckstation-qt/gamelistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,9 @@ QVariant GameListModel::data(const QModelIndex& index, int role, const GameList:

case Column_Players:
{
if (ge->dbentry->min_players == ge->dbentry->max_players)
if (!ge->dbentry || ge->dbentry->min_players == 0)
return QString();
else if (ge->dbentry->min_players == ge->dbentry->max_players)
return QStringLiteral("%1").arg(ge->dbentry->min_players);
else
return QStringLiteral("%1-%2").arg(ge->dbentry->min_players).arg(ge->dbentry->max_players);
Expand Down

0 comments on commit 2604df5

Please sign in to comment.