Permalink
Browse files

check for valid token AND keys

  • Loading branch information...
zagraves committed Dec 16, 2009
1 parent ce44fd8 commit fec94d52be5b72def43cf7599d1125adfa4a176b
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/YOSSocial/YOSAuthRequest.m
@@ -73,7 +73,7 @@ - (YOSRequestToken *)fetchRequestTokenWithCallbackUrl:(NSString *)callbackUrl
YOSRequestToken *requestToken = [YOSRequestToken tokenFromResponse:response.data];
- return (requestToken.key && requestToken.secret) ? requestToken : nil;
+ return (requestToken && requestToken.key && requestToken.secret) ? requestToken : nil;
}
- (NSURL *)authUrlForRequestToken:(YOSRequestToken *)requestToken
@@ -120,7 +120,7 @@ - (YOSAccessToken *)fetchAccessToken:(YOAuthToken *)requestOrAccessToken withVer
YOSAccessToken *accessToken = [YOSAccessToken tokenFromResponse:response.data];
- return (accessToken.key && accessToken.secret) ? accessToken : nil;
+ return (accessToken && accessToken.key && accessToken.secret) ? accessToken : nil;
}
@end

0 comments on commit fec94d5

Please sign in to comment.