Before trying to scroll to a span for a selected record, check that a span actually exists.