in Mentor::selectMentor(), we have:
$selectedMentorName = $possibleMentors[ rand( 0, count( $possibleMentors ) - 1 ) ]; $selectedMentor = User::newFromName( $selectedMentorName ); if ( !$selectedMentor || !$selectedMentor->getId() ) { throw new WikiConfigException( 'Invalid mentor: ' . $selectedMentorName ); } return $selectedMentor;
This means that if the Mentor page contains an invalid username (e.g. someone has a typo) and $selectedMentor is unlucky enough to be that invalid username, the mentor selection fails and the user has no mentor. We should probably keep trying the other mentor names until we find a valid one.