diff --git a/TrackingTools/GsfTracking/src/GsfTrajectorySmoother.cc b/TrackingTools/GsfTracking/src/GsfTrajectorySmoother.cc index 3317a57c3fd63..990403c6a2a25 100644 --- a/TrackingTools/GsfTracking/src/GsfTrajectorySmoother.cc +++ b/TrackingTools/GsfTracking/src/GsfTrajectorySmoother.cc @@ -129,6 +129,10 @@ Trajectory GsfTrajectorySmoother::trajectory(const Trajectory& aTraj) const { if (theMerger) predTsos = theMerger->merge(predTsos); + if (!predTsos.isValid()) { + return Trajectory(); + } + if ((*itm).recHit()->isValid()) { //update currTsos = updator()->update(predTsos, *(*itm).recHit()); @@ -204,6 +208,9 @@ Trajectory GsfTrajectorySmoother::trajectory(const Trajectory& aTraj) const { if (theMerger) currTsos = theMerger->merge(currTsos); + if (!currTsos.isValid()) { + return Trajectory(); + } dump(currTsos, "currTsos", "GsfTrackFitters"); }