From e3302975756e7c3eb5f48ee7ed3e550db6a99658 Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 28 Dec 2011 19:50:07 +0100 Subject: Don't try to read first item in DbAnalyzerDialog when list is empty Don't crash when data is empty in DbAnalyzerDialog::populate or the last item was deleted. --- dbanalyzer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dbanalyzer.cpp b/dbanalyzer.cpp index d121f6b..7243e68 100644 --- a/dbanalyzer.cpp +++ b/dbanalyzer.cpp @@ -284,6 +284,9 @@ void DbAnalyzerDialog::deleteMarks(){ } void DbAnalyzerDialog::populate(QTreeView *view, SmTreeModel *model, const QList > &data, const QHash &marks){ + if(data.isEmpty()){ + return; + } const int columns = data.first().count(); if(columns == 0){ return; -- cgit v1.2.3-70-g09d2