diff --git a/lib/secure-streams/secure-streams.c b/lib/secure-streams/secure-streams.c index 3d5f58f5e..c28230495 100644 --- a/lib/secure-streams/secure-streams.c +++ b/lib/secure-streams/secure-streams.c @@ -1381,8 +1381,10 @@ lws_ss_to_cb(lws_sorted_usec_list_t *sul) if (r != LWSSSSRET_DISCONNECT_ME && r != LWSSSSRET_DESTROY_ME) return; - if (h->wsi) - lws_set_timeout(h->wsi, 1, LWS_TO_KILL_ASYNC); + if (!h->wsi) + return; + + lws_set_timeout(h->wsi, 1, LWS_TO_KILL_ASYNC); _lws_ss_handle_state_ret_CAN_DESTROY_HANDLE(r, h->wsi, &h); }