From e43c0e59a656a27d875304e59d1429d6d4a412d5 Mon Sep 17 00:00:00 2001 From: Joris <joris.l@hotmail.com> Date: Wed, 24 Nov 2021 12:57:02 +0100 Subject: [PATCH] error handling --- cypher/convertQuery.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cypher/convertQuery.go b/cypher/convertQuery.go index 2f8be46..f15a3d3 100644 --- a/cypher/convertQuery.go +++ b/cypher/convertQuery.go @@ -17,6 +17,10 @@ func (s *Service) ConvertQuery(totalJSONQuery *entity.IncomingQueryJSON) (*strin query, rest, isRest := checkForQueryCluster(queryJSON) + if query == nil { + return nil, errors.New("Invalid query") + } + if isRest { fmt.Println("Rest:") fmt.Println(rest) -- GitLab