Improve error message for missing main component

This commit is contained in:
Unrud 2017-08-23 13:36:35 +02:00
parent 574961417d
commit 31564c7cf2

View File

@ -312,6 +312,8 @@ def _visit_time_ranges(vobject_item, child_name, range_fn, infinity_fn):
if main is not None: if main is not None:
raise ValueError("Multiple main components") raise ValueError("Multiple main components")
main = comp main = comp
if main is None:
raise ValueError("Main component missing")
yield main, False, recurrences yield main, False, recurrences
# Comments give the lines in the tables of the specification # Comments give the lines in the tables of the specification