From fa2d8ef8ee243b1106e5c475bb1306ccc20e90f7 Mon Sep 17 00:00:00 2001 From: worker-9 Date: Tue, 10 Aug 2021 11:30:58 -0400 Subject: [PATCH] changed not and else --- controllers/authGrpc.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controllers/authGrpc.go b/controllers/authGrpc.go index 0728c528..a7b903fc 100644 --- a/controllers/authGrpc.go +++ b/controllers/authGrpc.go @@ -81,7 +81,7 @@ func grpcAuthorize(ctx context.Context) error { } emptynode := models.Node{} node, err := functions.GetNodeByMacAddress(network, mac) - if !database.IsEmptyRecord(err) { + if database.IsEmptyRecord(err) { if node, err = functions.GetDeletedNodeByMacAddress(network, mac); err != nil { if !database.IsEmptyRecord(err) { if functions.RemoveDeletedNode(node.ID) { @@ -90,7 +90,8 @@ func grpcAuthorize(ctx context.Context) error { } return status.Errorf(codes.Unauthenticated, "Node does not exist.") } - } else if err != nil || node.MacAddress == emptynode.MacAddress { + } + if err != nil || node.MacAddress == emptynode.MacAddress { return status.Errorf(codes.Unauthenticated, "Node does not exist.") }