[ntcore] Don't check type string on publishing an entry (#5816)

Only check the raw type value.
This commit is contained in:
Peter Johnson
2023-10-24 00:12:02 -07:00
committed by GitHub
parent 23ea188e60
commit 8efa586ace

View File

@@ -858,14 +858,14 @@ LocalStorage::PublisherData* LocalStorage::Impl::PublishEntry(EntryData* entry,
if (entry->publisher) {
return entry->publisher;
}
auto typeStr = TypeToString(type);
if (entry->subscriber->config.type == NT_UNASSIGNED) {
auto typeStr = TypeToString(type);
entry->subscriber->config.type = type;
entry->subscriber->config.typeStr = typeStr;
} else if (entry->subscriber->config.type != type ||
entry->subscriber->config.typeStr != typeStr) {
} else if (entry->subscriber->config.type != type) {
if (!IsNumericCompatible(type, entry->subscriber->config.type)) {
// don't allow dynamically changing the type of an entry
auto typeStr = TypeToString(type);
ERR("cannot publish entry {} as type {}, previously subscribed as {}",
entry->topic->name, typeStr, entry->subscriber->config.typeStr);
return nullptr;