diff --git a/ntcore/src/main/native/cpp/net/ServerImpl.cpp b/ntcore/src/main/native/cpp/net/ServerImpl.cpp index cd5a23c51ea..8dc5291a4ad 100644 --- a/ntcore/src/main/native/cpp/net/ServerImpl.cpp +++ b/ntcore/src/main/native/cpp/net/ServerImpl.cpp @@ -1708,7 +1708,9 @@ ServerImpl::TopicData* ServerImpl::CreateTopic(ClientData* client, auto& tcd = topic->clients[aClient.get()]; bool added = false; for (auto subscriber : subscribers) { - added = added || tcd.AddSubscriber(subscriber); + if (tcd.AddSubscriber(subscriber)) { + added = true; + } } if (added) { aClient->UpdatePeriod(tcd, topic);