summaryrefslogtreecommitdiffhomepage
path: root/src/python/nxt_python_asgi_websocket.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/python/nxt_python_asgi_websocket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/python/nxt_python_asgi_websocket.c b/src/python/nxt_python_asgi_websocket.c
index fc7d9fa4..ab1d0324 100644
--- a/src/python/nxt_python_asgi_websocket.c
+++ b/src/python/nxt_python_asgi_websocket.c
@@ -980,6 +980,10 @@ nxt_py_asgi_websocket_close_handler(nxt_unit_request_info_t *req)
nxt_unit_req_debug(req, "asgi_websocket_close_handler");
+ if (nxt_slow_path(ws == NULL)) {
+ return;
+ }
+
if (ws->receive_future == NULL) {
ws->state = NXT_WS_DISCONNECTED;