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:
+3
-2
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user