yaffs direct: Add some NULL pointer handling