vladukua / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

NPE during OAuthGetTemporaryToken #111

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version: google-api-client-1.2.2-alpha
Environment: Android

When attempting to dance with LoVEFILM, I'm getting the following:

FATAL EXCEPTION: IntentService[AuthorizationService]
java.lang.NullPointerException
    at com.google.api.client.http.UrlEncodedParser.parse(UrlEncodedParser.java:139)
    at com.google.api.client.auth.oauth.AbstractOAuthGetToken.execute(AbstractOAuthGetToken.java:67)
    at com.ctoforaday.livefilm.AuthorizationService.onHandleIntent(AuthorizationService.java:40)
    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:123)
    at android.os.HandlerThread.run(HandlerThread.java:60)

Now, I can't tell what it's doing yet, but it definitely shouldn't be doing 
that.  It suggests that, while parsing, the map is null.  I believe that's 
because the OAuthCredentialsResponse isn't itself a Map.

The problem with that is that LOVEFiLM is attempting to tell me in the response 
(I believe) which URL to use; I believe they set one (today, possibly two 
tomorrow) login_url value in the response containing the URL to use when 
authenticating.

I *think* that's triggering this NPE, when it goes to set the map value and 
can't.

Now, as it happens, I don't need that map value - though it'd be nice to let 
them tell me, I'm happy to hardcode.  However, Either OAuthCredentialsResponse 
needs to support Map, or UrlEncodedParser shouldn't throw under these 
circumstances.

Or both.

Original issue reported on code.google.com by gblock@google.com on 3 Feb 2011 at 9:00

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 3 Feb 2011 at 9:22

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 4 Feb 2011 at 2:59

GoogleCodeExporter commented 9 years ago
Fixed.  If you can please verify that this fixes the bug by checking out the 
code directly from Hg and building.  See:

http://google-api-java-client.googlecode.com/hg/instructions.html?r=default

Original comment by yan...@google.com on 4 Feb 2011 at 3:42

GoogleCodeExporter commented 9 years ago
Verified.  Happy happy, joy joy.

Original comment by gblock@google.com on 4 Feb 2011 at 7:40

GoogleCodeExporter commented 9 years ago
Issue 110 has been merged into this issue.

Original comment by yan...@google.com on 18 Feb 2011 at 1:27