aomatsu / gtm-oauth2

Automatically exported from code.google.com/p/gtm-oauth2
0 stars 0 forks source link

Invalid convertion from BOOL to (NSMutableDictionary*) #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In GTMOAuth2SignIn.m, the -[GTMOAuth2SignIn parametersForWebRequest] method may 
return "NO" if both hasClientID and hasRedirect are both "NO".

> - (NSMutableDictionary *)parametersForWebRequest {
>   GTMOAuth2Authentication *auth = self.authentication;
>   NSString *clientID = auth.clientID;
>   NSString *redirectURI = auth.redirectURI;
> 
>   BOOL hasClientID = ([clientID length] > 0);
>   BOOL hasRedirect = ([redirectURI length] > 0
>                       || redirectURI == [[self class] 
nativeClientRedirectURI]);
>   if (!hasClientID || !hasRedirect) {
> #if DEBUG
>     NSAssert(hasClientID, @"GTMOAuth2SignIn: clientID needed");
>     NSAssert(hasRedirect, @"GTMOAuth2SignIn: redirectURI needed");
> #endif
>     return NO;
>   }

Here, the "return NO;" should either be "return nil;" or "return 
[NSMutableDictionary dictionaryWithObjectsAndKeys:nil];".

Original issue reported on code.google.com by sdefresne@chromium.org on 16 Jan 2014 at 2:27

GoogleCodeExporter commented 9 years ago
Fixed in https://code.google.com/p/gtm-oauth2/source/detail?r=121

Original comment by grobb...@google.com on 17 Jan 2014 at 2:38