null checks on pointer creation