From 8efa586acea39d179cc4e8aa1b1196db14834a1a Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 24 Oct 2023 00:12:02 -0700 Subject: [PATCH] [ntcore] Don't check type string on publishing an entry (#5816) Only check the raw type value. --- ntcore/src/main/native/cpp/LocalStorage.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ntcore/src/main/native/cpp/LocalStorage.cpp b/ntcore/src/main/native/cpp/LocalStorage.cpp index 5c732e4253e..0377f4ffc91 100644 --- a/ntcore/src/main/native/cpp/LocalStorage.cpp +++ b/ntcore/src/main/native/cpp/LocalStorage.cpp @@ -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;