[pim/kdepim-addons] pimautogeneratetext/src: Make be safe here

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 2c724d372c56458e4cc787a0339d07d30ce5ab39 by Laurent Montel.
Committed on 15/08/2026 at 12:48.
Pushed by mlaurent into branch 'master'.

Make be safe here

M  +4    -0    pimautogeneratetext/src/autogenerateconfigureaskmodel.cpp

https://invent.kde.org/pim/kdepim-addons/-/commit/2c724d372c56458e4cc787a0339d07d30ce5ab39

diff --git a/pimautogeneratetext/src/autogenerateconfigureaskmodel.cpp b/pimautogeneratetext/src/autogenerateconfigureaskmodel.cpp
index f299224b3..77c5d5d29 100644
--- a/pimautogeneratetext/src/autogenerateconfigureaskmodel.cpp
+++ b/pimautogeneratetext/src/autogenerateconfigureaskmodel.cpp
@@ -50,6 +50,10 @@ bool AutogenerateConfigureAskModel::setData(const QModelIndex &idx, const QVaria
         return false;
     }
     const int id = idx.row();
+    if (id < 0 || id >= mAskInfos.count()) {
+        qCWarning(PIMAUTOGENERATE_LOG) << "ERROR: invalid index" << id;
+        return false;
+    }
     auto &info = mAskInfos[id];
     switch (role) {
     case AskRoles::TitleRole: {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.