Fix warning for lists

Empty lists seem to be returning a null of some sorts, made sure that
it's an array before looping over it. See #22 props @mcvick for pointing
out a correct fix.