Added additional check when attempting to retrieve permissions for a list item.  Make sure it has a valid ID because it could be an item that hasn't been saved yet which would return incorrect permissions.