fix: Handle NoneType error in MsPowerpointDocumentBackend (#1747)
fix:nonetyperror in pptx backend Signed-off-by: Bruno Rigal <bruno.rigal@probayes.com> Co-authored-by: Bruno Rigal <bruno.rigal@probayes.com>
This commit is contained in:
parent
df140227c3
commit
7a275c7637
@ -423,18 +423,21 @@ class MsPowerpointDocumentBackend(DeclarativeDocumentBackend, PaginatedDocumentB
|
|||||||
# Handle notes slide
|
# Handle notes slide
|
||||||
if slide.has_notes_slide:
|
if slide.has_notes_slide:
|
||||||
notes_slide = slide.notes_slide
|
notes_slide = slide.notes_slide
|
||||||
notes_text = notes_slide.notes_text_frame.text.strip()
|
if notes_slide.notes_text_frame is not None:
|
||||||
if notes_text:
|
notes_text = notes_slide.notes_text_frame.text.strip()
|
||||||
bbox = BoundingBox(l=0, t=0, r=0, b=0)
|
if notes_text:
|
||||||
prov = ProvenanceItem(
|
bbox = BoundingBox(l=0, t=0, r=0, b=0)
|
||||||
page_no=slide_ind + 1, charspan=[0, len(notes_text)], bbox=bbox
|
prov = ProvenanceItem(
|
||||||
)
|
page_no=slide_ind + 1,
|
||||||
doc.add_text(
|
charspan=[0, len(notes_text)],
|
||||||
label=DocItemLabel.TEXT,
|
bbox=bbox,
|
||||||
parent=parent_slide,
|
)
|
||||||
text=notes_text,
|
doc.add_text(
|
||||||
prov=prov,
|
label=DocItemLabel.TEXT,
|
||||||
content_layer=ContentLayer.FURNITURE,
|
parent=parent_slide,
|
||||||
)
|
text=notes_text,
|
||||||
|
prov=prov,
|
||||||
|
content_layer=ContentLayer.FURNITURE,
|
||||||
|
)
|
||||||
|
|
||||||
return doc
|
return doc
|
||||||
|
Loading…
Reference in New Issue
Block a user