In the case that a null PlanStageStats* gets pushed onto the tree of children stats passed to PlanRanker::hasStage(), this method will attempt to access 'stageType' on this null pointer and seg fault.
I imagine that in theory, null PlanStageStats pointers should never be passed to this method. However, the MockStage currently returns NULL as its stats, and that is able to propagate through to this point and crash the system.