Skip to content

Commit 4c5b399

Browse files
committed
more robust focused_bid (empty string)
1 parent 41c6a76 commit 4c5b399

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

browsergym/core/src/browsergym/core/observation.py

+4
Original file line numberDiff line numberDiff line change
@@ -568,4 +568,8 @@ def extract_focused_element_bid(page: playwright.sync_api.Page):
568568
except playwright.sync_api.TimeoutError:
569569
focused_bid = ""
570570

571+
# convert null / None to empty string
572+
if not focused_bid:
573+
focused_bid = ""
574+
571575
return focused_bid

0 commit comments

Comments
 (0)