]> code.delx.au - webdl/commitdiff
Safely handle missing data in iView
authorJames Bunton <jamesbunton@delx.net.au>
Sun, 19 May 2019 10:57:07 +0000 (20:57 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Sun, 19 May 2019 10:57:07 +0000 (20:57 +1000)
iview.py

index dc1ea7c7a0dd29ad81d4b990dd0689abeded555f..50395cfc2bb0c18dc997dd8b10381cd2e7a1d347 100644 (file)
--- a/iview.py
+++ b/iview.py
@@ -69,7 +69,7 @@ class IviewIndexNode(Node):
     def fill_children(self):
         info = grab_json(self.url)
         for key in ["carousels", "collections", "index"]:
-            for collection_list in info[key]:
+            for collection_list in info.get(key, None):
                 if isinstance(collection_list, dict):
                     for ep_info in collection_list.get("episodes", []):
                         self.add_series(ep_info)