Skip to content

Commit e280d15

Browse files
committed
checks if back exists before indexing into it; fixes #90
1 parent 7cef542 commit e280d15

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

allofplos/article_class.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ def __str__(self, exclude_refs=True):
5757
if exclude_refs:
5858
root = tree.getroot()
5959
back = tree.xpath('./back')
60-
root.remove(back[0])
60+
if back:
61+
root.remove(back[0])
6162
local_xml = et.tostring(tree,
6263
method='xml',
6364
encoding='unicode',

0 commit comments

Comments
 (0)