Skip to content

Commit

Permalink
Protect for possible nullptrs in system exit.
Browse files Browse the repository at this point in the history
  • Loading branch information
PMSeitzer committed Sep 12, 2019
1 parent 8613491 commit 9036c19
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/maven/masscalcgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,16 @@ void MassCalcWidget::showTable() {
QString ppmDiff = QString::number( matches[i].diff , 'f', 2);
QString rtDiff = QString::number(matches[i].rtdiff,'f', 1);
QString matchScore = QString::number( matches[i].fragScore.getScoreByName(scoringAlgorithm) , 'f', 3);
QString adductName = QString(a->name.c_str());
QString db = QString(c->db.c_str());

QString adductName = QString("");
if (a) {
adductName = QString(a->name.c_str());
}

QString db = QString("");
if (c){
db = QString(c->db.c_str());
}

//filter hits by database
if (databaseSelect->currentText() != "All" and databaseSelect->currentText() != db) continue;
Expand Down

0 comments on commit 9036c19

Please sign in to comment.