- Fixed missing NULL check