Skip to content

Commit 8bfa207

Browse files
committed
Fix TrendCheck creating Quality without a name
A default Quality would be created when TrendCheck::beautify was trying to access a non-existent entry in mQualities map. When using operator[] with a missing key, the object is added using the default constructor, so Quality(10, "") was being created. This was causing crashes in QualityTask, which was relying on a non-empty Quality name to be there.
1 parent 622afde commit 8bfa207

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Modules/Common/src/TrendCheck.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,9 @@ void TrendCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult
436436

437437
auto graphName = moName + "_" + std::to_string(graphIndex);
438438

439+
if (!mQualities.contains(graphName)) {
440+
continue;
441+
}
439442
Quality quality = mQualities[graphName];
440443

441444
if (mThresholdsTrendMedium.count(graphName) > 0) {

0 commit comments

Comments
 (0)