Skip to content

Commit

Permalink
When checking if StreamListItem is called from a non-list function, d…
Browse files Browse the repository at this point in the history
…o not through errors for anonymous functions. Closes #147
  • Loading branch information
kaidaguerre committed Jul 13, 2021
1 parent 1fa0e6b commit d8d3734
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugin/query_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,13 @@ func (d *QueryData) verifyCallerIsListCall(callingFunction string) bool {
listFunction := helpers.GetFunctionName(d.Table.List.Hydrate)
listParentFunction := helpers.GetFunctionName(d.Table.List.ParentHydrate)
if callingFunction != listFunction && callingFunction != listParentFunction {
return false
// if the calling function is NOT one of the other registered hydrate functions,
//it must be an anonymous function so let it go
for _, c := range d.Table.Columns {
if c.Hydrate != nil && helpers.GetFunctionName(c.Hydrate) == callingFunction {
return false
}
}
}
return true
}
Expand Down

0 comments on commit d8d3734

Please sign in to comment.