From f32cd16f77f85c290fd548c0d20d8e2ff16a0659 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sat, 5 Apr 2014 17:14:55 +0400 Subject: [PATCH] Extra runtime check in CanIOManager queue --- libuavcan/src/transport/uc_can_io.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libuavcan/src/transport/uc_can_io.cpp b/libuavcan/src/transport/uc_can_io.cpp index 20fe36bf66..e3a45a4ef5 100644 --- a/libuavcan/src/transport/uc_can_io.cpp +++ b/libuavcan/src/transport/uc_can_io.cpp @@ -136,6 +136,11 @@ void CanTxQueue::push(const CanFrame& frame, MonotonicTime tx_deadline, Qos qos, // Find a frame with lowest QoS Entry* p = queue_.get(); + if (p == NULL) + { + UAVCAN_TRACE("CanTxQueue", "Push rejected: Nothing to replace"); + return; + } Entry* lowestqos = p; while (p) {