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:
Bruno Rigal 2025-06-10 19:43:20 +02:00 committed by GitHub
parent df140227c3
commit 7a275c7637
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -423,18 +423,21 @@ class MsPowerpointDocumentBackend(DeclarativeDocumentBackend, PaginatedDocumentB
# Handle notes slide
if slide.has_notes_slide:
notes_slide = slide.notes_slide
notes_text = notes_slide.notes_text_frame.text.strip()
if notes_text:
bbox = BoundingBox(l=0, t=0, r=0, b=0)
prov = ProvenanceItem(
page_no=slide_ind + 1, charspan=[0, len(notes_text)], bbox=bbox
)
doc.add_text(
label=DocItemLabel.TEXT,
parent=parent_slide,
text=notes_text,
prov=prov,
content_layer=ContentLayer.FURNITURE,
)
if notes_slide.notes_text_frame is not None:
notes_text = notes_slide.notes_text_frame.text.strip()
if notes_text:
bbox = BoundingBox(l=0, t=0, r=0, b=0)
prov = ProvenanceItem(
page_no=slide_ind + 1,
charspan=[0, len(notes_text)],
bbox=bbox,
)
doc.add_text(
label=DocItemLabel.TEXT,
parent=parent_slide,
text=notes_text,
prov=prov,
content_layer=ContentLayer.FURNITURE,
)
return doc