diff --git a/Reconstruction/Jet/JetMomentTools/Root/JetCaloEnergies.cxx b/Reconstruction/Jet/JetMomentTools/Root/JetCaloEnergies.cxx index 16fe3e117421d3af1f165acd9478aacaffc6ad68..6969d4c06d0ebb57333247da7d33dd712558414a 100644 --- a/Reconstruction/Jet/JetMomentTools/Root/JetCaloEnergies.cxx +++ b/Reconstruction/Jet/JetMomentTools/Root/JetCaloEnergies.cxx @@ -209,7 +209,7 @@ void JetCaloEnergies::fillEperSamplingFE(const xAOD::Jet& jet, std::vector<float for (size_t n = 0; n < constit->otherObjects().size(); ++n) { if(! constit->otherObject(n)) continue; - int index_pfo = constit->otherObject(n)->index(); + int index_pfo = constit->otherObject(n)->index(); if(index_pfo<0) continue; const auto* fe = (constit->otherObject(n)); @@ -222,7 +222,7 @@ void JetCaloEnergies::fillEperSamplingFE(const xAOD::Jet& jet, std::vector<float //If we have a PFO, we should still get the associated cluster first else { const xAOD::FlowElement* pfo = dynamic_cast<const xAOD::FlowElement*>(fe); - if(pfo->otherObjects().size() > 0 && pfo->otherObject(0)->type() == xAOD::Type::CaloCluster){ + if(pfo->otherObjects().size() > 0 && pfo->otherObject(0) && pfo->otherObject(0)->type() == xAOD::Type::CaloCluster){ cluster = dynamic_cast<const xAOD::CaloCluster*> (pfo->otherObject(0)); } }