Prevent crash when array object ends up nil

This would be due to another issue somewhere else, but let's at least
not crash hard.