diff --git a/rpc/datapool.go b/rpc/datapool.go index fd6f3d3..56a20cc 100644 --- a/rpc/datapool.go +++ b/rpc/datapool.go @@ -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) { diff --git a/rpc/proxy.go b/rpc/proxy.go index 9ee09e4..65bd158 100644 --- a/rpc/proxy.go +++ b/rpc/proxy.go @@ -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