Minor code refactor on search result template to avoid PHP warning.