fix($location): don't call `indexOf()` of undefined `href` attribute

Closes #7721
this initial commit is really just here to test this on the CI server...