Added NULL pointer guarding
p4#: 21157