Packets: support is<SomePacketType>() for in-valid Packets
[senf.git] / senf / Packets / Packet.cti
index 5d79a2b..9ba8a4b 100644 (file)
@@ -54,7 +54,7 @@ template <class OtherPacket>
 prefix_ bool senf::Packet::is()
     const
 {
-    return ptr()->is<typename OtherPacket::type>();
+    return valid() && ptr()->is<typename OtherPacket::type>();
 }
 
 template <class OtherPacket>