diff --git a/ntcore/src/main/native/cpp/net/ServerImpl.cpp b/ntcore/src/main/native/cpp/net/ServerImpl.cpp index 832cff0986..4dbb3e82a2 100644 --- a/ntcore/src/main/native/cpp/net/ServerImpl.cpp +++ b/ntcore/src/main/native/cpp/net/ServerImpl.cpp @@ -211,14 +211,14 @@ void ServerImpl::ClientData4Base::ClientPublish(int64_t pubuid, pubuid, std::make_unique(this, topic, pubuid)); if (!isNew) { WARN("client {} duplicate publish of pubuid {}", m_id, pubuid); + } else { + // add publisher to topic + topic->AddPublisher(this, publisherIt->getSecond().get()); + + // update meta data + m_server.UpdateMetaTopicPub(topic); } - // add publisher to topic - topic->AddPublisher(this, publisherIt->getSecond().get()); - - // update meta data - m_server.UpdateMetaTopicPub(topic); - // respond with announce with pubuid to client DEBUG4("client {}: announce {} pubuid {}", m_id, topic->name, pubuid); SendAnnounce(topic, pubuid);