mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix potential getitem error in resolve_anyref
This commit is contained in:
parent
633c5ad9c6
commit
57ae92ce78
@ -125,7 +125,7 @@ class ReferencesResolver(SphinxPostTransform):
|
||||
for role in domain.roles:
|
||||
res = domain.resolve_xref(self.env, refdoc, self.app.builder,
|
||||
role, target, node, contnode)
|
||||
if res and isinstance(res[0], nodes.Element):
|
||||
if res and len(res) > 0 and isinstance(res[0], nodes.Element):
|
||||
results.append(('%s:%s' % (domain.name, role), res))
|
||||
# now, see how many matches we got...
|
||||
if not results:
|
||||
|
Loading…
Reference in New Issue
Block a user