Qt: Fix crash when players column is visible
This commit is contained in:
parent
11c212260c
commit
2604df5917
|
@ -447,7 +447,9 @@ QVariant GameListModel::data(const QModelIndex& index, int role, const GameList:
|
||||||
|
|
||||||
case Column_Players:
|
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);
|
return QStringLiteral("%1").arg(ge->dbentry->min_players);
|
||||||
else
|
else
|
||||||
return QStringLiteral("%1-%2").arg(ge->dbentry->min_players).arg(ge->dbentry->max_players);
|
return QStringLiteral("%1-%2").arg(ge->dbentry->min_players).arg(ge->dbentry->max_players);
|
||||||
|
|
Loading…
Reference in New Issue