Skip to content

Commit 029451f

Browse files
TomasDadoguitargeek
authored andcommitted
[RF] Fix RooAbsCollection::contentsString() for empty collections
Closes #20189.
1 parent 8ac08e7 commit 029451f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

roofit/roofitcore/src/RooAbsCollection.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,9 @@ std::string RooAbsCollection::contentsString() const
11541154
retVal += ",";
11551155
}
11561156

1157-
retVal.erase(retVal.end()-1);
1157+
if (!retVal.empty()) {
1158+
retVal.erase(retVal.end()-1);
1159+
}
11581160

11591161
return retVal;
11601162
}

0 commit comments

Comments
 (0)