- if (hardware_device)
- multiple_dev = any_of(devices_.begin(), devices_.end(),
- [&](shared_ptr<HardwareDevice> dev) {
+ const bool multiple_dev = hardware_device && any_of(
+ devices_.begin(), devices_.end(),
+ [&](shared_ptr<HardwareDevice> dev) {