Chromium Code Reviews| Index: tools/battor_agent/battor_finder.cc |
| diff --git a/tools/battor_agent/battor_finder.cc b/tools/battor_agent/battor_finder.cc |
| index 0aa54ac12b3b87aaa6fbdff7e757c750e965f963..e51ae712307f2407e129c075bb51022f0e479e34 100644 |
| --- a/tools/battor_agent/battor_finder.cc |
| +++ b/tools/battor_agent/battor_finder.cc |
| @@ -38,7 +38,9 @@ std::string BattOrFinder::FindBattOr() { |
| // If we have no switch-specified path, look for a device with the right |
| // display name. |
| for (size_t i = 0; i < devices.size(); i++) { |
| - std::string display_name = devices[i]->display_name.get(); |
| + if (!devices[i]->display_name) |
| + continue; |
| + auto& display_name = devices[i]->display_name.value(); |
|
scottmg
2016/11/14 17:22:48
Sorry, I couldn't figure out what type display_nam
yzshen1
2016/11/14 17:27:55
Its type is now base::Optional<std::string>.
Cha
|
| if (display_name.find(kBattOrDisplayNamePrefix) != std::string::npos) { |
| LOG(INFO) << "Found BattOr with display name " << display_name |
| << " at path " << devices[i]->path; |