diff --git a/lib/roles/h2/http2.c b/lib/roles/h2/http2.c index 29a5dc2d8..be28537d9 100644 --- a/lib/roles/h2/http2.c +++ b/lib/roles/h2/http2.c @@ -390,6 +390,11 @@ lws_h2_issue_preface(struct lws *wsi) struct lws_h2_netconn *h2n = wsi->h2.h2n; struct lws_h2_protocol_send *pps; + if (!h2n) { + lwsl_warn("%s: no valid h2n\n", __func__); + return 1; + } + lwsl_debug("%s: %s: fd %d\n", __func__, lws_wsi_tag(wsi), (int)wsi->desc.sockfd); if (lws_issue_raw(wsi, (uint8_t *)preface, strlen(preface)) !=