Skip to content

Commit

Permalink
Check against arg nil (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelewski authored May 23, 2024
1 parent 6a53af8 commit 605d352
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions quesma/queryparser/where_clause/string_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ func (v *StringRenderer) VisitInfixOp(e *InfixOp) interface{} {
func (v *StringRenderer) VisitPrefixOp(e *PrefixOp) interface{} {
args := make([]string, len(e.Args))
for i, arg := range e.Args {
args[i] = arg.Accept(v).(string)
if arg != nil {
args[i] = arg.Accept(v).(string)
}
}

argsAsString := strings.Join(args, ", ")
Expand All @@ -50,7 +52,9 @@ func (v *StringRenderer) VisitPrefixOp(e *PrefixOp) interface{} {
func (v *StringRenderer) VisitFunction(e *Function) interface{} {
args := make([]string, len(e.Args))
for i, arg := range e.Args {
args[i] = arg.Accept(v).(string)
if arg != nil {
args[i] = arg.Accept(v).(string)
}
}

argsAsString := strings.Join(args, ",")
Expand Down

0 comments on commit 605d352

Please sign in to comment.