Fixed null pointer for document serializer