search: do not panic in query string function
Created by: rvantonder
This asString
function is dangerous. It doesn't do exhaustive checking on the states of *searchquerytypes.Value
. The field values v.String
, v.Regexp
, v.Bool
could all be nil, or v
could be nil, etc. I'm not fixing up all of that, instead, let's just return a string and not panic.
The uses for asString
appear luckily safe for now, and I ran into this while changing some parser logic, so we are potentially one small change away from nil panicking without this PR.