You are getting the item twice, in the if, and inside the if, i would move this line above the if, and in the if just check:
if item is not None: