diff --git a/src/gui/peptide_detail_view/peptidewindow.cpp b/src/gui/peptide_detail_view/peptidewindow.cpp
index a94c305792823848445787fc69a1693c2a4df828..b1071d75cd7e5d7bf713e6047a220ac7d509c1b4 100644
--- a/src/gui/peptide_detail_view/peptidewindow.cpp
+++ b/src/gui/peptide_detail_view/peptidewindow.cpp
@@ -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