diff --git a/lib/core/libwebsockets.c b/lib/core/libwebsockets.c index b9b2564a7..404506f12 100644 --- a/lib/core/libwebsockets.c +++ b/lib/core/libwebsockets.c @@ -2162,6 +2162,8 @@ lws_partial_buffered(struct lws *wsi) LWS_VISIBLE lws_fileofs_t lws_get_peer_write_allowance(struct lws *wsi) { + if (!wsi->role_ops->tx_credit) + return -1; return wsi->role_ops->tx_credit(wsi); }