Fix for calling a member of a null pointer