Fix overzealous matching on URL; and fix "Non-string URLs" from Twitter.
[hermes] / package / src / org / maemo / hermes / engine / friend.py
index 28b8d74..632f33a 100644 (file)
@@ -27,13 +27,15 @@ class Friend():
     # public accessors -----------------
     
     def add_url(self, url):
-        if not isinstance(url, basestring):
-            print url
-            raise Exception('Not valid to add non-string URLs')
-        self._add('url', url)
+       if url:
+           if not isinstance(url, basestring):
+               print url
+               raise Exception('Not valid to add non-string URLs')
+            self._add('url', url)
     
     def add_phone(self, phone):
-        self._add('phone', phone)
+       if phone:
+            self._add('phone', phone)
         
     def get_birthday_date(self):
         return self._safe_get('bday')