From 8f5b2410d5208b3edf9aa6ae2589f6c54da893a4 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 5 Aug 2011 17:42:21 +0200 Subject: [PATCH] Fix bat seg fault in FileSet view --- bacula/src/qt-console/fileset/fileset.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bacula/src/qt-console/fileset/fileset.cpp b/bacula/src/qt-console/fileset/fileset.cpp index 13f6c5482b..6efe7ae6a7 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -70,7 +70,6 @@ FileSet::~FileSet() */ void FileSet::populateTable() { - m_populated = true; Freeze frz(*tableWidget); /* disable updating*/ @@ -171,6 +170,7 @@ void FileSet::populateTable() } } } + m_populated = true; } /* @@ -195,7 +195,7 @@ void FileSet::PgSeltreeWidgetClicked() void FileSet::tableItemChanged(QTableWidgetItem *currentwidgetitem, QTableWidgetItem *previouswidgetitem) { /* m_checkcurwidget checks to see if this is during a refresh, which will segfault */ - if (m_checkcurwidget) { + if (m_checkcurwidget && currentwidgetitem) { int currentRow = currentwidgetitem->row(); QTableWidgetItem *currentrowzeroitem = tableWidget->item(currentRow, 0); m_currentlyselected = currentrowzeroitem->text(); @@ -252,7 +252,7 @@ void FileSet::consoleShowFileSet() */ void FileSet::currentStackItem() { - if(!m_populated) { + if (!m_populated) { populateTable(); /* Create the context menu for the fileset table */ createContextMenu(); -- 2.39.5