Fail on None before iteration attempt

Check for a 'None' value before trying to iterate over it
in the bulk code. Also eliminates an unneccessary anonymous
recursive function in the same bulk handling code.

Closes-Bug: #1368055
Change-Id: Id4aca81e4882a3cdf9c790bdea0b0b515abc9a8c
Merge "Fail on None before iteration attempt"