I am curious as to what part of the dereferencing a NULL ptr causes undesired behavior. Example:
// #1 someObj * a; a = NULL; (*a).somefunc(); // crash, dere
you need to know more about anotherfunc() to tell what will happen when you pass it null. it might be fine, it might crash, depends on the code.