Skip to content
Snippets Groups Projects
Commit 77b5831d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix crash in mqtt_startup() when configured broker isn't reachable

parent 6cbbad21
No related branches found
No related tags found
No related merge requests found
...@@ -503,7 +503,8 @@ int mqtt_startup(struct mqtt* mqtt, scfg_t* cfg, struct startup* startup, const ...@@ -503,7 +503,8 @@ int mqtt_startup(struct mqtt* mqtt, scfg_t* cfg, struct startup* startup, const
mqtt_pub_uintval(mqtt, TOPIC_SERVER, "served", mqtt->served); mqtt_pub_uintval(mqtt, TOPIC_SERVER, "served", mqtt->served);
#ifdef USE_MOSQUITTO #ifdef USE_MOSQUITTO
mosquitto_message_callback_set(mqtt->handle, mqtt_message_received); if(mqtt->handle != NULL)
mosquitto_message_callback_set(mqtt->handle, mqtt_message_received);
#endif #endif
if(mqtt->startup->type == SERVER_TERM) { if(mqtt->startup->type == SERVER_TERM) {
bbs_startup_t* bbs_startup = (bbs_startup_t*)startup; bbs_startup_t* bbs_startup = (bbs_startup_t*)startup;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment