don't iterate through null arrays, fixes #140