Skip to content

Commit

Permalink
Fixed crash in WS event handler when backend is unreachable
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Jan 8, 2021
1 parent c194d6f commit ba0b83b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions events/janus_wsevh.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,11 @@ static void *janus_wsevh_handler(void *data) {
}

static int janus_wsevh_callback(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len) {
if(ws_client == NULL)
ws_client = (janus_wsevh_client *)user;
switch(reason) {
case LWS_CALLBACK_CLIENT_ESTABLISHED: {
/* Prepare the session */
if(ws_client == NULL)
ws_client = (janus_wsevh_client *)user;
ws_client->wsi = wsi;
ws_client->buffer = NULL;
ws_client->buflen = 0;
Expand Down

0 comments on commit ba0b83b

Please sign in to comment.