diff --git a/src/net.c b/src/net.c index 9357d852..421fbd30 100644 --- a/src/net.c +++ b/src/net.c @@ -917,7 +917,9 @@ coap_read(coap_context_t *ctx) { * help with anything, so we set it simply to the last return value * retrieved from coap_read_endpoint(). */ LL_FOREACH_SAFE(ctx->endpoint, ep, tmp) { - result = coap_read_endpoint(ctx, ep); + if ((ep->flags & COAP_ENDPOINT_HAS_DATA) != 0) { + result = coap_read_endpoint(ctx, ep); + } } return result;