Fix tests in case category doesn't exist

This edge case should never happen IRL, but the idea is that if the user is on a category page that doesn't exist and the categories load, this will prevent an undefined lookup.