Skip to content

Commit 240f3de

Browse files
committed
Add missing optional check.
1 parent 906af00 commit 240f3de

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/hws/cpu/hardware_sampler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ void cpu_hardware_sampler::sampling_loop() {
618618
} else {
619619
if (this->sample_category_enabled(sample_category::idle_state)) {
620620
const std::string header_str{ header[i] };
621-
if (idle_state_samples_.idle_states_.value().count(header_str) > decltype(idle_state_samples_)::map_type::size_type{ 0 }) {
621+
if (idle_state_samples_.idle_states_.has_value() && idle_state_samples_.idle_states_.value().count(header_str) > decltype(idle_state_samples_)::map_type::size_type{ 0 }) {
622622
using vector_type = cpu_idle_states_samples::map_type::mapped_type;
623623
idle_state_samples_.idle_states_.value()[header_str].push_back(detail::convert_to<typename vector_type::value_type>(values[i]));
624624
}

0 commit comments

Comments
 (0)