Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
- Fixed potential accessing of invalid iterator
Browse files Browse the repository at this point in the history
Signed-off-by: Hayden Briese <[email protected]>
  • Loading branch information
hbriese committed Dec 8, 2020
1 parent 1cf6ab5 commit a6f2abb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void fc::Controller::test(fc::FanInterface &fan, bool forced, bool blocking,
return;

// If a test is already running for the device then just join onto it
if (auto it = tasks.find(fan.label); it->second.is_testing()) {
if (auto it = tasks.find(fan.label); it != tasks.end() && it->second.is_testing()) {
// Add test_status observers to existing test_status
for (const auto &cb : test_status->observers)
it->second.test_status->register_observer(cb, true);
Expand Down

0 comments on commit a6f2abb

Please sign in to comment.