Skip to content

Commit

Permalink
Add type detection to ElementHandle.fill
Browse files Browse the repository at this point in the history
Resolves: #1189 (comment)
  • Loading branch information
inancgumus committed Jan 25, 2024
1 parent 0b17a30 commit 06d01be
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/element_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ func (h *ElementHandle) fill(_ context.Context, value string) error {
return err
}
s, ok := result.(string)
if !ok {
return fmt.Errorf("unexpected type %T", result)
}
if ok && s != resultDone {
// Either we're done or an error happened (returned as "error:..." from JS)
return errorFromDOMError(s)
Expand Down

0 comments on commit 06d01be

Please sign in to comment.