Mqtt: don't set will on empty topic

This commit is contained in:
andig 2025-05-20 20:39:02 +02:00
parent f4ef8e4081
commit c7898f06d9

View file

@ -610,7 +610,7 @@ func configureMqtt(conf *globalconfig.Mqtt) error {
log := util.NewLogger("mqtt")
instance, err := mqtt.RegisteredClient(log, conf.Broker, conf.User, conf.Password, conf.ClientID, 1, conf.Insecure, conf.CaCert, conf.ClientCert, conf.ClientKey, func(options *paho.ClientOptions) {
if !runAsService {
if !runAsService || conf.Topic == "" {
return
}