$location might be an empty array.