From: Kern Sibbald Date: Fri, 5 Aug 2011 15:42:21 +0000 (+0200) Subject: Fix bat seg fault in FileSet view X-Git-Tag: Release-7.0.0~594 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=678ac620581c5808bd178dd105ee0f7cf18c9e65;p=bacula%2Fbacula Fix bat seg fault in FileSet view --- 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();