[datafeed] don't crash if url is not specified
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 04 Oct 2011 18:45:38 +0200
changeset 7910 e5d5609e3bf1
parent 7907 08320697ca1a
child 7913 d0c6a7993cec
[datafeed] don't crash if url is not specified
server/sources/datafeed.py
--- a/server/sources/datafeed.py	Tue Oct 04 12:23:52 2011 +0200
+++ b/server/sources/datafeed.py	Tue Oct 04 18:45:38 2011 +0200
@@ -82,9 +82,11 @@
         source_entity.complete()
         self.parser_id = source_entity.parser
         self.latest_retrieval = source_entity.latest_retrieval
-        self.urls = [url.strip() for url in source_entity.url.splitlines()
-                     if url.strip()]
-
+        if source_entity.url:
+            self.urls = [url.strip() for url in source_entity.url.splitlines()
+                         if url.strip()]
+        else:
+            self.urls = []
     def update_config(self, source_entity, typedconfig):
         """update configuration from source entity. `typedconfig` is config
         properly typed with defaults set