diff --git a/RingBufCPP.h b/RingBufCPP.h index 2ad61cf..d1c3732 100644 --- a/RingBufCPP.h +++ b/RingBufCPP.h @@ -59,7 +59,10 @@ bool pull(Type *dest) { if (!isEmpty()) { tail = getTail(); - *dest = _buf[tail]; + if (dest) + { + *dest = _buf[tail]; + } _numElements--; ret = true;