Handle documents without editions

If a document has no editions then
SpecialistDocumentRepository#fetch(document_id) will return nil. That's
no use, and causes an error when sorting, so compact the collection of
documents after building it.