Minor tweak to stats example.
authortjkopena@cs.drexel.edu
Wed, 24 Jun 2009 10:57:52 -0400
changeset 4582 9c5c28319c73
parent 4581 83581b0ccfa0
child 4585 a720292fcd24
Minor tweak to stats example.
examples/stats/wifi-example-apps.cc
--- a/examples/stats/wifi-example-apps.cc	Wed Jun 24 10:43:52 2009 -0400
+++ b/examples/stats/wifi-example-apps.cc	Wed Jun 24 10:57:52 2009 -0400
@@ -250,11 +250,14 @@
     }
 
     TimestampTag timestamp;
-    packet->FindFirstMatchingByteTag(timestamp);
-    Time tx = timestamp.GetTimestamp();
+    // Should never not be found since the sender is adding it, but
+    // you never know.
+    if (packet->FindFirstMatchingByteTag(timestamp)) {
+      Time tx = timestamp.GetTimestamp();
 
-    if (m_delay != 0) {
-      m_delay->Update(Simulator::Now() - tx);
+      if (m_delay != 0) {
+        m_delay->Update(Simulator::Now() - tx);
+      }
     }
 
     if (m_calc != 0) {