don't assume that there's more than one activity
[librarian.git] / librarian / pypdf.py
index b99f6ad..bb2881f 100644 (file)
@@ -261,7 +261,7 @@ class EduModule(Xmill):
 
         counter = self.activity_counter
 
-        if element.getnext().tag == 'aktywnosc' or self.activity_last.getnext() == element:
+        if element.getnext().tag == 'aktywnosc' or (self.activity_last and self.activity_last.getnext() == element):
             counter_tex = """<cmd name="activitycounter"><parm>%(counter)d.</parm></cmd>""" % locals()
         else:
             counter_tex = ''