Commit f77f1984 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

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

parent fe1db772
Pipeline #3661 passed with stage
in 6 minutes and 17 seconds
......@@ -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);
#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
if(mqtt->startup->type == SERVER_TERM) {
bbs_startup_t* bbs_startup = (bbs_startup_t*)startup;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment