utils/tracers: Fixing bug that resulted in segmentation faults in L3(Aggregate|Rate)Tracer
diff --git a/utils/tracers/ndn-l3-aggregate-tracer.cc b/utils/tracers/ndn-l3-aggregate-tracer.cc
index 52eb9f8..b64fc6b 100644
--- a/utils/tracers/ndn-l3-aggregate-tracer.cc
+++ b/utils/tracers/ndn-l3-aggregate-tracer.cc
@@ -187,8 +187,11 @@
{
std::map<Ptr<const Face>, boost::tuple<Stats, Stats> >::iterator stats = m_stats.find (Ptr<const Face> (0));
- PRINTER ("SatisfiedInterests", m_satisfiedInterests);
- PRINTER ("TimedOutInterests", m_timedOutInterests);
+ if (stats != m_stats.end ())
+ {
+ PRINTER ("SatisfiedInterests", m_satisfiedInterests);
+ PRINTER ("TimedOutInterests", m_timedOutInterests);
+ }
}
}