Adding some guards to the BaseDoctrineMapper::processResult()