Skip to content

Commit

Permalink
fix: avoid panic
Browse files Browse the repository at this point in the history
  • Loading branch information
electricbubble committed Feb 21, 2022
1 parent 195417e commit c8e4d30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ func NewUSBDriver(capabilities Capabilities, device ...Device) (driver WebDriver
if device, err = DeviceList(); err != nil {
return nil, err
}
if len(device) == 0 {
return nil, errors.New("no device")
}
}
dev := device[0]

Expand Down

0 comments on commit c8e4d30

Please sign in to comment.