diff --git a/lib/include/srslte/common/msg_queue.h b/lib/include/srslte/common/msg_queue.h index 8e73caa00..e3a86941d 100644 --- a/lib/include/srslte/common/msg_queue.h +++ b/lib/include/srslte/common/msg_queue.h @@ -131,7 +131,10 @@ public: uint32_t size_tail_bytes() { pthread_mutex_lock(&mutex); - uint32_t r = buf[tail]->N_bytes; + uint32_t r = 0; + if (buf[tail]) { + r = buf[tail]->N_bytes; + } pthread_mutex_unlock(&mutex); return r; }