Skip to content

Commit 322ac61

Browse files
maxpillCopilot
andcommitted
Apply suggestions from code review
Co-authored-by: Copilot <[email protected]>
1 parent 8aff205 commit 322ac61

File tree

1 file changed

+4
-3
lines changed
  • packages/ragbits-document-search/src/ragbits/document_search/ingestion/parsers/pptx/extractors

1 file changed

+4
-3
lines changed

packages/ragbits-document-search/src/ragbits/document_search/ingestion/parsers/pptx/extractors/extractors.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def _extract_hyperlink_content(self, shape: BaseShape) -> str | None:
112112
"""Extract hyperlink content from a shape."""
113113
if not hasattr(shape, "click_action") or isinstance(shape, GroupShape):
114114
return None
115-
if not shape.click_action.hyperlink.address:
115+
if not shape.click_action.hyperlink or not shape.click_action.hyperlink.address:
116116
return None
117117
return shape.click_action.hyperlink.address
118118

@@ -237,9 +237,10 @@ def extract(
237237
if sld.has_notes_slide and sld.notes_slide.notes_text_frame is not None:
238238
notes_slide = sld.notes_slide
239239
notes_text_frame = notes_slide.notes_text_frame
240-
text = notes_text_frame.text.strip() if notes_text_frame is not None else None
240+
text = getattr(notes_text_frame, "text", None)
241+
text = text.strip() if text else None
241242

242-
if text and notes_text_frame is not None:
243+
if text:
243244
coordinates = {
244245
"left": notes_text_frame.margin_left,
245246
"right": notes_text_frame.margin_right,

0 commit comments

Comments
 (0)