Skip to content

Commit

Permalink
checks if back exists before indexing into it; fixes #90
Browse files Browse the repository at this point in the history
  • Loading branch information
mpacer committed Mar 4, 2018
1 parent 8a7c9ce commit 6758f7f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion allofplos/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def __str__(self, exclude_refs=True):
if exclude_refs:
root = tree.getroot()
back = tree.xpath('./back')
root.remove(back[0])
if back:
root.remove(back[0])
local_xml = et.tostring(tree,
method='xml',
encoding='unicode',
Expand Down

0 comments on commit 6758f7f

Please sign in to comment.