cwschmidt/gtm-oauth2

Invalid convertion from BOOL to (NSMutableDictionary*)

GoogleCodeExporter opened this issue · 1 comments

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

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

  • Changed state: Fixed