Added check for $paginator == null