Fix KeyError when the document is empty and the calling code use the extra_dict.
Fix KeyError when the document is empty and the calling code use the extra_dict.

TamiaLab/carnetdumaker,TamiaLab/carnetdumaker,TamiaLab/carnetdumaker,TamiaLab/carnetdumaker