From 4addfc99d5dbb4f00fc3749bbb69f572b130963f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Tue, 28 Feb 2012 11:02:34 +0100 Subject: [PATCH] Fix a bug : try to find parent on a NULL operation in TabDelegate --- src/view/grid/TabDelegate.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/view/grid/TabDelegate.cpp b/src/view/grid/TabDelegate.cpp index 44abac6..5a57d00 100644 --- a/src/view/grid/TabDelegate.cpp +++ b/src/view/grid/TabDelegate.cpp @@ -38,7 +38,8 @@ void TabDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, QLineEdit *line = qobject_cast(editor); QString value = line->text().trimmed(); - if ((*_operations)[index.row()].parent) + if (index.row() < _operations->size() && (*_operations)[index.row()].id && + (*_operations)[index.row()].parent) model->setData(index, qVariantFromValue(" " + value)); else model->setData(index, qVariantFromValue(value));