]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix bat seg fault in FileSet view
authorKern Sibbald <kern@sibbald.com>
Fri, 5 Aug 2011 15:42:21 +0000 (17:42 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:59 +0000 (14:49 +0200)
bacula/src/qt-console/fileset/fileset.cpp

index 13f6c5482b2a768c19eb24185f36db1395e13018..6efe7ae6a75b5cd09fd500ec748e56332f01f2a2 100644 (file)
@@ -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();