Fix NPE by fconnecting the partitioner to the document earlier