Merge pull request #653 from alrs/ble-swap-error-returns

modules/ble: Swap Error Return
This commit is contained in:
evilsocket 2019-11-25 11:32:36 +01:00 committed by GitHub
commit 114ac90ce0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,7 +64,7 @@ func (mod *BLERecon) doFilter(dev *network.BLEDevice) bool {
mod.selector.Expression.MatchString(dev.Vendor) mod.selector.Expression.MatchString(dev.Vendor)
} }
func (mod *BLERecon) doSelection() (err error, devices []*network.BLEDevice) { func (mod *BLERecon) doSelection() (devices []*network.BLEDevice, err error) {
if err = mod.selector.Update(); err != nil { if err = mod.selector.Update(); err != nil {
return return
} }
@ -127,7 +127,7 @@ func (mod *BLERecon) colNames(withName bool) []string {
} }
func (mod *BLERecon) Show() error { func (mod *BLERecon) Show() error {
err, devices := mod.doSelection() devices, err := mod.doSelection()
if err != nil { if err != nil {
return err return err
} }