Skip to content

Commit c0b5de8

Browse files
mpacereseiver
authored andcommitted
checks if back exists before indexing into it; fixes #90
1 parent 4e11abf commit c0b5de8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

allofplos/article.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ def __str__(self, exclude_refs=True):
5959
if exclude_refs:
6060
root = tree.getroot()
6161
back = tree.xpath('./back')
62-
root.remove(back[0])
62+
if back:
63+
root.remove(back[0])
6364
local_xml = et.tostring(tree,
6465
method='xml',
6566
encoding='unicode',

0 commit comments

Comments
 (0)