Skip to content

Commit

Permalink
Fix crash in isAllowed()
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicletz committed May 10, 2024
1 parent e803d9d commit e1f7e76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rpc/datapool.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (p *DataPool) GetCacheOrResolveBNS(deviceName string, client *Client) ([]Ad
return bns, nil
}

return nil, nil
return nil, errEmptyBNSresult
}

func (p *DataPool) GetCacheOrResolvePeers(deviceName string, client *Client) ([]Address, error) {
Expand Down
4 changes: 4 additions & 0 deletions rpc/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ func (proxyServer *ProxyServer) isAllowedDevice(deviceName string) (err error) {
return
}

if len(deviceIDs) == 0 {
err = fmt.Errorf("device not found")
return
}
deviceID := deviceIDs[0]

// Checking blocklist and allowlist
Expand Down

0 comments on commit e1f7e76

Please sign in to comment.