From d491eda986026c084fa9eb60e0949cd4d83a552c Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 27 May 2010 19:02:26 +0200 Subject: [PATCH] Fix an AttributeError for strange xref nodes. --- sphinx/writers/latex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 0e8de719d..34bfd2521 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -1058,7 +1058,8 @@ class LaTeXTranslator(nodes.NodeVisitor): # reference to a label id = uri[1:].replace('#', ':') self.body.append(self.hyperlink(id)) - if len(node) and 'std-term' in node[0].get('classes', []): + if len(node) and hasattr(node[0], 'attributes') and \ + 'std-term' in node[0].get('classes', []): # don't add a pageref for glossary terms self.context.append('}') else: