Skip to content

NullPointerException org.scribe.model.Response #492

Closed

Description

@wateringcan

by calling method Response.getBody() if the Body of the Response is null.
Bugfix would be:

package org.scribe.model;
//....
  private String parseBodyContents()
  {
    try{
      body = StreamUtils.getStreamContents(getStream());
      return body;
    }catch(Exception e){
      return "";
    }
  }

Activity

  1. HarpreetSandhu commented on Jul 9, 2014

    @HarpreetSandhu

    whats the exact problem ,,, u r facing here .,, can u please elaborate it .

  2. wateringcan commented on Jul 9, 2014

    @wateringcan
    Author

    Hi,

    I ran in an error500 while using the XING-Api. The caught error
    message does not contain a body. In this case scripe ran on a null
    pointer. The fix, which I  posted, will catch and handle this
    Exception.
    lg
    LCQ

    ----- Ursprüngliche Nachricht -----
    Von: "fernandezpablo85/scribe-java"
    An:"fernandezpablo85/scribe-java"
    Cc:"wateringcan"
    Gesendet:Tue, 08 Jul 2014 18:07:48 -0700
    Betreff:Re: [scribe-java] NullPointerException
    org.scribe.model.Response (#492)

    whats the exact problem ,,, u r facing here .,, can u please
    

    elaborate it .

    —
    

    Reply to this email directly or view it on GitHub [1]. Freemail 38.DE:

    • meine Region, meine Freemail.

    Links:

    [1]
    #492 (comment)

  3. otbzi commented on Nov 11, 2014

    @otbzi

    I encountered this bug too.

    I build a request to get bitbucket resource. Then returned me 401, and the response body is null, and the stream is also null.

    Then the code crashed.....

  4. kullfar commented on Nov 22, 2017

    @kullfar
    Member

    It seems, the issue is quite outdated and not relevant to the current state of source code.
    If no one interested, I will close issue in one month

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions