Search compare function checks if one of the parameters is null