[CalendarServer-changes] [8601] CalDAVClientLibrary/trunk/caldavclientlibrary/client/principal.py

source_changes at macosforge.org source_changes at macosforge.org
Sat Jan 28 18:05:47 PST 2012


Revision: 8601
          http://trac.macosforge.org/projects/calendarserver/changeset/8601
Author:   cdaboo at apple.com
Date:     2012-01-28 18:05:45 -0800 (Sat, 28 Jan 2012)
Log Message:
-----------
Handle a missing path.

Modified Paths:
--------------
    CalDAVClientLibrary/trunk/caldavclientlibrary/client/principal.py

Modified: CalDAVClientLibrary/trunk/caldavclientlibrary/client/principal.py
===================================================================
--- CalDAVClientLibrary/trunk/caldavclientlibrary/client/principal.py	2012-01-28 22:36:10 UTC (rev 8600)
+++ CalDAVClientLibrary/trunk/caldavclientlibrary/client/principal.py	2012-01-29 02:05:45 UTC (rev 8601)
@@ -28,7 +28,7 @@
         self.cache = {}
         
     def getPrincipal(self, session, path, refresh=False):
-        if path.toString() not in self.cache:
+        if path and path.toString() not in self.cache:
             principal = CalDAVPrincipal(session, path)
             principal.loadDetails()
             self.cache[path.toString()] = principal
@@ -38,7 +38,7 @@
                     self.cache[uri] = principal
         elif refresh:
             self.cache[path.toString()].loadDetails(refresh=True)
-        return self.cache[path.toString()]
+        return self.cache[path.toString()] if path else None
 
 principalCache = PrincipalCache()
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120128/8050c656/attachment.html>


More information about the calendarserver-changes mailing list