Skip to content

Commit

Permalink
fixing nil in json extract scalar (#6)
Browse files Browse the repository at this point in the history
Co-authored-by: Matan Levy <malevy@paloaltonetworks.com>
  • Loading branch information
MatanLevy and Matan Levy committed Dec 17, 2023
1 parent 446e8f3 commit c5efcb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/function_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func JSON_EXTRACT_SCALAR(v, path string) (Value, error) {
if err := p.Unmarshal([]byte(v), &values); err != nil {
return nil, err
}
if len(values) == 0 {
if len(values) == 0 || values[0] == nil {
return nil, nil
}
value := values[0]
Expand Down

0 comments on commit c5efcb9

Please sign in to comment.