Skip to content

Commit

Permalink
Refs #9119. Fix "Dereference after null-check" errors
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbekasov committed Mar 5, 2014
1 parent 8a94029 commit 95bbfa8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp
Expand Up @@ -1083,8 +1083,11 @@ void MuonAnalysis::groupTableChanged(int row, int column)
{
QTableWidgetItem *itemName = m_uiForm.groupTable->item(row,0);

if ( itemName == NULL ) // this should never happen
m_uiForm.groupTable->setItem(row,0, new QTableWidgetItem(""));
if ( itemName == NULL ) // Just in case it wasn't assigned
{
itemName = new QTableWidgetItem("");
m_uiForm.groupTable->setItem(row, 0, itemName);
}

if ( itemName->text() != "" )
{
Expand Down Expand Up @@ -1166,8 +1169,11 @@ void MuonAnalysis::pairTableChanged(int row, int column)
{
QTableWidgetItem *itemName = m_uiForm.pairTable->item(row,0);

if ( itemName == NULL ) // this should never happen
m_uiForm.pairTable->setItem(row,0, new QTableWidgetItem(""));
if ( itemName == NULL ) // Just in case it wasn't assigned
{
itemName = new QTableWidgetItem("");
m_uiForm.pairTable->setItem(row, 0, itemName);
}

if ( itemName->text() != "" )
{
Expand Down

0 comments on commit 95bbfa8

Please sign in to comment.