Skip to content

Commit a84b2fa

Browse files
committed
Fix invalid iterator dereference in MaterialManager debug log
This fixes a crash-prone debug printout in MaterialManager::getDensity. - With O2SIM_MATMGR_LOCALDENSITY_DEBUG set and a global density factor other than 1, the log line read iter->second from an end() iterator. - The line now prints the global factor that is actually applied.
1 parent ca01776 commit a84b2fa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Detectors/Base/src/MaterialManager.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ float MaterialManager::getDensity(std::string const& modname, std::string const&
157157
// global factor
158158
const auto global = o2::conf::SimMaterialParams::Instance().globalDensityFactor;
159159
if (debug && global != 1.0) {
160-
LOG(info) << "MatManager - " << modname << "/" << matname << " : applying global density " << iter->second;
160+
LOG(info) << "MatManager - " << modname << "/" << matname << " : applying global density " << global;
161161
}
162162
return global;
163163
}

0 commit comments

Comments
 (0)