only write the message data if there is any

This commit is contained in:
Kevin Matz 2023-04-09 20:09:03 -04:00
parent 7663b84ec5
commit ca24b7878c

View File

@ -126,7 +126,8 @@ void DmxWidget::sendMessage(std::shared_ptr<ENTTEC::Pro::MessageData> msg) const
*stream << ENTTEC::Pro::START_DELIMITER;
*stream << msg->label;
*stream << length;
*stream << msg;
if (length)
*stream << msg;
*stream << ENTTEC::Pro::END_DELIMITER;
port_->write(reinterpret_cast<char*>(buffer), sizeof(buffer));