search/query: check for nil Pattern in String and StringHuman
Created by: keegancsmith
While playing around I noticed some panics in my printf debugging. The reason was that Pattern was nil. Instead of copy pasting the fix in both String and StringHuman, a helper function is created.
Test Plan: CI
Edit: hoping this kicks pr-auditor