Skip to content

Commit

Permalink
device: return nil device on error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondrej Belusky authored and sethterashima committed May 21, 2024
1 parent 83b83ea commit 6536a17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/connector/ble/device_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ import (
)

func newDevice() (ble.Device, error) {
return darwin.NewDevice()
device, err := darwin.NewDevice()
if err != nil {
return nil, err
}
return device, nil
}
6 changes: 5 additions & 1 deletion pkg/connector/ble/device_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ import (
)

func newDevice() (ble.Device, error) {
return linux.NewDevice()
device, err := linux.NewDevice()
if err != nil {
return nil, err
}
return device, nil
}

0 comments on commit 6536a17

Please sign in to comment.