use a ternary assignment for query portion

to avoid calling [0] on null when pth.match(QUERY) doesn't match anything.
Merge pull request #3 from songkick/master

use a ternary assignment for query portion