handle undefined, add test
Merge pull request #2093 from w33ble/to-user

Validate Query formatter - handle undefined