Support empty menu response

In recent weeks many API calls return "null".
Instead of letting the request fail, the parser
now treats "null" as empty menu.
This commit is contained in:
f4lco
2020-03-28 21:12:17 +01:00
parent 0208bffb73
commit e0079a537f
4 changed files with 24 additions and 14 deletions
+3 -2
View File
@@ -58,8 +58,9 @@ def render_menu(menu):
"""
builder = LazyBuilder()
for day in _active_days(menu):
_process_day(builder, day)
if menu:
for day in _active_days(menu):
_process_day(builder, day)
return builder.toXMLFeed()