diff --git a/DataFormats/SiStripCluster/interface/SiStripApproximateClusterCollection.h b/DataFormats/SiStripCluster/interface/SiStripApproximateClusterCollection.h index a582b25a4eab1..142706dfe4bda 100644 --- a/DataFormats/SiStripCluster/interface/SiStripApproximateClusterCollection.h +++ b/DataFormats/SiStripCluster/interface/SiStripApproximateClusterCollection.h @@ -90,7 +90,7 @@ class SiStripApproximateClusterCollection { void reserve(std::size_t dets, std::size_t clusters); Filler beginDet(unsigned int detId); - const_iterator begin() const { return const_iterator(this); } + const_iterator begin() const { return clusters_.empty() ? end() : const_iterator(this); } const_iterator cbegin() const { return begin(); } const_iterator end() const { return const_iterator(); } const_iterator cend() const { return end(); }