Skip to content
Snippets Groups Projects

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.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading