Skip to content

Commit

Permalink
Fix not returning WindowId when valid.
Browse files Browse the repository at this point in the history
b/342003753
  • Loading branch information
briantting committed May 29, 2024
1 parent 05cfe09 commit e786301
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cobalt/webdriver/protocol/window_id.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ const char kWindowNameKey[] = "name";

base::Optional<WindowId> WindowId::FromValue(const base::Value* value) {
const base::Value::Dict* dictionary_value = value->GetIfDict();
if (!dictionary_value) {
return absl::nullopt;
if (dictionary_value) {
const std::string* window_id = dictionary_value->FindString(kWindowNameKey);
if (window_id) {
return WindowId(*window_id);
}
}
return base::nullopt;
}
Expand Down

0 comments on commit e786301

Please sign in to comment.