Permalink
Browse files

request might not have a facebook attribute

  • Loading branch information...
1 parent 2159c31 commit 8a9dd9a9dc6766b257ddc76730ea39c38e904065 @ptarjan committed Jul 22, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 facebookconnect/middleware.py
@@ -98,8 +98,9 @@ def process_request(self,request):
# Because this is a middleware, we can't assume the errors will
# be caught anywhere useful.
logout(request)
- request.facebook.session_key = None
- request.facebook.uid = None
+ if hasattr(request, 'facebook'):
+ request.facebook.session_key = None
+ request.facebook.uid = None
log.exception(ex)
return None

0 comments on commit 8a9dd9a

Please sign in to comment.