diff --git a/components/modules/mqtt.c b/components/modules/mqtt.c index 3c4909aa..0f59a965 100644 --- a/components/modules/mqtt.c +++ b/components/modules/mqtt.c @@ -419,7 +419,7 @@ static int mqtt_connect(lua_State* L) { ESP_LOGD(TAG, "connect: mqtt_context*: %p", mqtt_context); - if (config.broker.address.uri != NULL) + if (config.broker.address.uri == NULL) { config.broker.address.port = port; config.broker.address.transport =