From 2604df5917d95373061ef74ccc6ee59df164e805 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 14 Oct 2024 12:47:09 +1000 Subject: [PATCH] Qt: Fix crash when players column is visible --- src/duckstation-qt/gamelistmodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/duckstation-qt/gamelistmodel.cpp b/src/duckstation-qt/gamelistmodel.cpp index 3514aa6365..e9cb77547f 100644 --- a/src/duckstation-qt/gamelistmodel.cpp +++ b/src/duckstation-qt/gamelistmodel.cpp @@ -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);