From 56e145ecd8fe7c3b0e3e52853d4e89ea9aeefe7e Mon Sep 17 00:00:00 2001 From: Dmitry Zagorodnev Date: Mon, 20 Feb 2023 14:24:25 +0300 Subject: [PATCH] Fix: lrcompletermodel.h out of range --- limereport/scripteditor/lrcompletermodel.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/limereport/scripteditor/lrcompletermodel.h b/limereport/scripteditor/lrcompletermodel.h index 862437a..eeab147 100644 --- a/limereport/scripteditor/lrcompletermodel.h +++ b/limereport/scripteditor/lrcompletermodel.h @@ -12,7 +12,9 @@ public: CompleterItem(QString text, QIcon icon):m_parent(0), m_text(text), m_icon(icon), m_model(0){} ~CompleterItem(); int rowCount() const {return m_children.count();} - CompleterItem* child(int row) const {return m_children.at(row).data();} + CompleterItem *child(int row) const { + return m_children.count() < row ? m_children.at(row).data() : nullptr; + } CompleterItem* parent() const {return m_parent;} int row() const{ if (m_parent){