From 924af81eaee990cfc0c3c4f1004db17f7e557af6 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 25 Feb 2015 20:21:44 +0200 Subject: [PATCH] Rows in list can't be more than count(); --HG-- branch : develop --- src/app/dialogs/tools/dialogdetail.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/dialogs/tools/dialogdetail.cpp b/src/app/dialogs/tools/dialogdetail.cpp index cbbe47047..d3d909b94 100644 --- a/src/app/dialogs/tools/dialogdetail.cpp +++ b/src/app/dialogs/tools/dialogdetail.cpp @@ -340,11 +340,12 @@ void DialogDetail::ClickedReverse(bool checked) */ void DialogDetail::ObjectChanged(int row) { - if (ui.listWidget->count() == 0 || row == -1) + if (ui.listWidget->count() == 0 || row == -1 || row >= ui.listWidget->count()) { return; } const QListWidgetItem *item = ui.listWidget->item( row ); + SCASSERT(item != nullptr); const VNodeDetail node = qvariant_cast(item->data(Qt::UserRole)); ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx())); ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy()));