Skip to content

Commit 0a3dd3a

Browse files
committed
properly set comment markAsFailure without prior comment
1 parent ee7cec2 commit 0a3dd3a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

core/src/storage.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,13 @@ void SolutionBase::setCost(double cost) {
190190

191191
void SolutionBase::markAsFailure(const std::string& msg) {
192192
setCost(std::numeric_limits<double>::infinity());
193-
if (!msg.empty())
194-
setComment(msg + "\n" + comment());
193+
if (!msg.empty()) {
194+
std::stringstream ss;
195+
ss << msg;
196+
if (!comment().empty())
197+
ss << "\n" << comment();
198+
setComment(ss.str());
199+
}
195200
}
196201

197202
void SolutionBase::fillInfo(moveit_task_constructor_msgs::SolutionInfo& info, Introspection* introspection) const {

0 commit comments

Comments
 (0)