From 6ef95c4a4eacb59239a7ae47d1708ea2c3033640 Mon Sep 17 00:00:00 2001 From: Allen Nikka Date: Mon, 23 Jun 2025 18:31:47 -0700 Subject: [PATCH] Fixes #1681 on upstream Signed-off-by: Allen Nikka --- docling/backend/msword_backend.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docling/backend/msword_backend.py b/docling/backend/msword_backend.py index 8386082a..3e84d643 100644 --- a/docling/backend/msword_backend.py +++ b/docling/backend/msword_backend.py @@ -397,7 +397,11 @@ class MsWordDocumentBackend(DeclarativeDocumentBackend): if isinstance(c, Hyperlink): text = c.text hyperlink = Path(c.address) - format = self._get_format_from_run(c.runs[0]) + format = ( + self._get_format_from_run(c.runs[0]) + if c.runs and len(c.runs) > 0 + else None + ) elif isinstance(c, Run): text = c.text hyperlink = None