fix: write empty topics (mqtt)

This commit is contained in:
Yurii
2024-02-04 04:31:19 +03:00
parent 4d199876fb
commit 9c47bf1ddb

View File

@@ -128,7 +128,7 @@ public:
size_t written = 0; size_t written = 0;
bool result = false; bool result = false;
if (!length || buffer == nullptr) { if (!length || buffer == nullptr) {
result = this->client->beginMessage(topic, 0, retained) && this->client->endMessage(); result = this->client->beginMessage(topic, retained) && this->client->endMessage();
} else if (this->client->beginMessage(topic, length, retained)) { } else if (this->client->beginMessage(topic, length, retained)) {
this->write(buffer, length); this->write(buffer, length);