Skip to content

Commit 9cc0ea1

Browse files
quotuvapicnixz
andauthored
[build] texinfo: fix crash in reference nodes without children (#12389)
Co-authored-by: Bénédikt Tran <[email protected]>
1 parent 548f0f9 commit 9cc0ea1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sphinx/writers/texinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ def visit_reference(self, node: Element) -> None:
691691
# cases for the sake of appearance
692692
if isinstance(node.parent, (nodes.title, addnodes.desc_type)):
693693
return
694-
if isinstance(node[0], nodes.image):
694+
if len(node) != 0 and isinstance(node[0], nodes.image):
695695
return
696696
name = node.get('name', node.astext()).strip()
697697
uri = node.get('refuri', '')

0 commit comments

Comments
 (0)