diff --git a/isobus/include/isobus/isobus/isobus_virtual_terminal_working_set_base.hpp b/isobus/include/isobus/isobus/isobus_virtual_terminal_working_set_base.hpp index c9ab24a0..868527fe 100644 --- a/isobus/include/isobus/isobus/isobus_virtual_terminal_working_set_base.hpp +++ b/isobus/include/isobus/isobus/isobus_virtual_terminal_working_set_base.hpp @@ -63,7 +63,7 @@ namespace isobus std::uint16_t get_object_pool_faulting_object_id(); protected: - /// @brief Adds an object to the object tree, and replaces an object of the same type + /// @brief Adds an object to the object tree, and replaces an object /// if there's already one in the tree with the same ID. /// @param[in] objectToAdd The object to add to the object tree /// @returns true if the object was added or replaced, otherwise false diff --git a/isobus/src/isobus_virtual_terminal_working_set_base.cpp b/isobus/src/isobus_virtual_terminal_working_set_base.cpp index ea928438..dab35057 100644 --- a/isobus/src/isobus_virtual_terminal_working_set_base.cpp +++ b/isobus/src/isobus_virtual_terminal_working_set_base.cpp @@ -51,17 +51,11 @@ namespace isobus { bool retVal = false; - if ((nullptr != objectToAdd) && - ((!get_object_id_exists(objectToAdd->get_id())) || - (objectToAdd->get_object_type() == vtObjectTree[objectToAdd->get_id()]->get_object_type()))) + if (nullptr != objectToAdd) { vtObjectTree[objectToAdd->get_id()] = objectToAdd; retVal = true; } - else if (nullptr != objectToAdd) - { - CANStackLogger::error("[WS]: Cannot replace an object with duplicate ID %u with a different type of object." + isobus::to_string(static_cast(objectToAdd->get_id()))); - } return retVal; }