Skip to content
Snippets Groups Projects
Commit 4ec11557 authored by Langella Olivier's avatar Langella Olivier
Browse files

check nullptr on ion pointer

parent 15d518ef
No related branches found
No related tags found
No related merge requests found
......@@ -199,18 +199,26 @@ PeptideWindow::~PeptideWindow()
void
PeptideWindow::setIon(pappso::PeakIonIsotopeMatchCstSPtr ion)
{
QString plusstr = "+";
plusstr = plusstr.repeated(ion->getCharge());
_ion_label->setText(
QString("%1%2%3 (+%4) - th. isotope ratio %5%")
.arg(ion->getPeptideFragmentIonSp().get()->getPeptideIonName())
.arg(ion->getPeptideFragmentIonSp().get()->size())
.arg(plusstr)
.arg(ion->getPeptideNaturalIsotopeAverageSp().get()->getIsotopeNumber())
.arg((int)(ion->getPeptideNaturalIsotopeAverageSp()
.get()
->getIntensityRatio() *
100)));
if(ion == nullptr)
{
_ion_label->setText("");
}
else
{
QString plusstr = "+";
plusstr = plusstr.repeated(ion->getCharge());
_ion_label->setText(
QString("%1%2%3 (+%4) - th. isotope ratio %5%")
.arg(ion->getPeptideFragmentIonSp().get()->getPeptideIonName())
.arg(ion->getPeptideFragmentIonSp().get()->size())
.arg(plusstr)
.arg(
ion->getPeptideNaturalIsotopeAverageSp().get()->getIsotopeNumber())
.arg((int)(ion->getPeptideNaturalIsotopeAverageSp()
.get()
->getIntensityRatio() *
100)));
}
}
void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment