Fix KeyError in documents package See merge request !774 (cherry picked from commit fa4f54d3) 2835f036 Fix KeyError in documents package