Skip to content

Commit

Permalink
[ntcore] Don't check type string on publishing an entry (#5816)
Browse files Browse the repository at this point in the history
Only check the raw type value.
  • Loading branch information
PeterJohnson authored Oct 24, 2023
1 parent 23ea188 commit 8efa586
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ntcore/src/main/native/cpp/LocalStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8efa586

Please sign in to comment.