Mqtt: empty topic disables publishing

This commit is contained in:
andig 2025-05-20 20:28:23 +02:00
parent 6aa8e31167
commit f4ef8e4081

View file

@ -230,7 +230,7 @@ func runRoot(cmd *cobra.Command, args []string) {
valueChan <- util.Param{Key: keys.Startup, Val: true}
// setup mqtt publisher
if err == nil && conf.Mqtt.Broker != "" {
if err == nil && conf.Mqtt.Broker != "" && conf.Mqtt.Topic != "" {
var mqtt *server.MQTT
mqtt, err = server.NewMQTT(strings.Trim(conf.Mqtt.Topic, "/"), site)
if err == nil {