Skip to content

Commit

Permalink
Added error message in case a leaf name is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Dafarra authored and Nicogene committed May 13, 2024
1 parent de5b447 commit 61f32ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/librobometry/include/robometry/TreeNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ class TreeNode
return false;
}

if (name.empty()) {
std::cout << "The name of the node cannot be empty." << std::endl;
return false;
}

// insert the new e element in the map
const auto out = m_children.insert({name, node});
return out.second;
Expand Down
3 changes: 3 additions & 0 deletions src/librobometry/src/BufferManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ bool robometry::BufferManager::addChannel(const ChannelInfo &channel) {
if(ok) {
m_bufferConfig.channels.push_back(channel);
}
else {
std::cout << "Failed to add channel " << channel.name << std::endl;
}
return ok;
}

Expand Down

0 comments on commit 61f32ad

Please sign in to comment.