Skip to content

Commit

Permalink
more robust focused_bid (empty string)
Browse files Browse the repository at this point in the history
  • Loading branch information
gasse committed Dec 19, 2024
1 parent 41c6a76 commit 4c5b399
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions browsergym/core/src/browsergym/core/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,4 +568,8 @@ def extract_focused_element_bid(page: playwright.sync_api.Page):
except playwright.sync_api.TimeoutError:
focused_bid = ""

# convert null / None to empty string
if not focused_bid:
focused_bid = ""

return focused_bid

0 comments on commit 4c5b399

Please sign in to comment.