If the list is empty what happens? Looks like the old code accounted for an empty cursor