Add check

This commit is contained in:
cpq
2026-04-17 14:43:21 +01:00
parent 18464b1c89
commit 31568de0fb
2 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -3351,7 +3351,11 @@ static inline void mg_dash_ev_handler(struct mg_connection *c, int ev,
// Add this to automatically handle "get" and "set" JSON-RPC calls
struct mg_dash *dash = (struct mg_dash *) c->fn_data;
struct mg_ws_message *wm = (struct mg_ws_message *) ev_data;
mg_dash_process_msg(c, wm, dash->fields, dash->get, dash->set);
if (dash == NULL || dash->fields == NULL) {
mg_dash_error(c, wm->data, "%s", "no fields defined");
} else {
mg_dash_process_msg(c, wm, dash->fields, dash->get, dash->set);
}
}
}
// Copyright (c) 2023 Cesanta Software Limited
+5 -1
View File
@@ -213,6 +213,10 @@ static inline void mg_dash_ev_handler(struct mg_connection *c, int ev,
// Add this to automatically handle "get" and "set" JSON-RPC calls
struct mg_dash *dash = (struct mg_dash *) c->fn_data;
struct mg_ws_message *wm = (struct mg_ws_message *) ev_data;
mg_dash_process_msg(c, wm, dash->fields, dash->get, dash->set);
if (dash == NULL || dash->fields == NULL) {
mg_dash_error(c, wm->data, "%s", "no fields defined");
} else {
mg_dash_process_msg(c, wm, dash->fields, dash->get, dash->set);
}
}
}