Skip to content

Commit

Permalink
fix: _source.enable=false lead panic (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwzzz17 committed Jun 5, 2023
1 parent dbe8f67 commit a9ca99b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/uquery/source/source.go
Expand Up @@ -52,12 +52,14 @@ func Request(v interface{}) (*meta.Source, error) {
}

func Response(source *meta.Source, data []byte) map[string]interface{} {

ret := make(map[string]interface{})

// return empty
if !source.Enable {
return nil
return ret
}

ret := make(map[string]interface{})
err := json.Unmarshal(data, &ret)
if err != nil {
return nil
Expand Down

0 comments on commit a9ca99b

Please sign in to comment.