diff --git a/lib/server.c b/lib/server.c index 1132122b9..d66376b8b 100644 --- a/lib/server.c +++ b/lib/server.c @@ -470,7 +470,7 @@ upgrade_ws: lwsl_info("checking %s\n", protocol_name); n = 0; - while (context->protocols[n].callback) { + while (wsi->protocol && context->protocols[n].callback) { if (!wsi->protocol->name) { n++; continue;