From 7a8b0c9d49e34767962d3cbf8af99b663e43876d Mon Sep 17 00:00:00 2001 From: garak Date: Tue, 14 Feb 2023 03:11:18 -0500 Subject: [PATCH] fix crash in model data function --- src/ui/maplistmodels.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ui/maplistmodels.cpp b/src/ui/maplistmodels.cpp index 6c0a06d1b..b4f6e9dce 100644 --- a/src/ui/maplistmodels.cpp +++ b/src/ui/maplistmodels.cpp @@ -220,6 +220,8 @@ QModelIndex MapGroupModel::indexOfMap(QString mapName) { } QVariant MapGroupModel::data(const QModelIndex &index, int role) const { + if (!index.isValid()) return QVariant(); + int row = index.row(); int col = index.column();