From a59887980b036bb3af56cc515859fd12498271eb Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Tue, 31 Mar 2009 17:00:16 +0000 Subject: [PATCH] I was able to reproduce some segfaults by using the keyborad arrows going quickly through some tree and table items. This seems to solve them. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8668 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/restore/restoretree.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bacula/src/qt-console/restore/restoretree.cpp b/bacula/src/qt-console/restore/restoretree.cpp index ef7a01ac07..0c2924eb8f 100644 --- a/bacula/src/qt-console/restore/restoretree.cpp +++ b/bacula/src/qt-console/restore/restoretree.cpp @@ -1202,6 +1202,7 @@ void restoreTree::updateFileTableChecks() int rcnt = fileTable->rowCount(); for (int row=0; rowitem(row, 0); + if (!item) return; Qt::CheckState curState = item->checkState(); Qt::CheckState newState = Qt::PartiallyChecked; @@ -1243,6 +1244,7 @@ void restoreTree::updateVersionTableChecks() /* deterimine the default state from the state of the file */ QTableWidgetItem *fileTableItem = fileTable->item(fileTable->currentRow(), 0); + if (!fileTableItem) return; Qt::CheckState fileState = fileTableItem->checkState(); QString file = fileTableItem->text(); QString fullPath = dirName + file; @@ -1252,6 +1254,7 @@ void restoreTree::updateVersionTableChecks() int cnt = versionTable->rowCount(); for (int row=0; rowitem(row, 0); + if (!item) break; Qt::CheckState curState = item->checkState(); Qt::CheckState newState = Qt::Unchecked; -- 2.39.5