cursor was not checking cursor.getCount() > 0 before working with it,
could cause crash
Merge pull request #703 from garvankeeley/issue696

cursor was not checking cursor.getCount() > 0 before working with it,