Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getType fails with NullPointerException for responses without type #51

Open
roiros opened this issue Sep 5, 2013 · 3 comments
Open

Comments

@roiros
Copy link

roiros commented Sep 5, 2013

I'm getting a NullPointerException when calling the following method:
com.eclipsesource.restfuse.internal.ResponseImpl#getType

public MediaType getType() {
String type = clientResponse.getType().toString();
return MediaType.fromString( type );
}

I think it can be fixed by returning a null in this case
public MediaType getType() {
if (clientResponse.getType()==null)
return null;
String type = clientResponse.getType().toString();
return MediaType.fromString( type );
}

@hstaudacher
Copy link

Would you mind to open a pull request with your change and a testcase?

@roiros
Copy link
Author

roiros commented Sep 6, 2013

I wouldn't mind at all, but I'm having really hard time building the project

git clone
cd restfuse\com.eclipsesource.restfuse.test
mvn compile

fails :(
(I'm on a windows 7 machine, mvn is v3.1.0)

I don't want to submit code without building & running the test case
locally.

On Fri, Sep 6, 2013 at 9:33 AM, Holger Staudacher
[email protected]:

Would you mind to open a pull request with your change and a testcase?


Reply to this email directly or view it on GitHubhttps://github.com//issues/51#issuecomment-23921508
.

@roiros
Copy link
Author

roiros commented Sep 9, 2013

@hstaudacher Hi, just sent a push request with the testcase and a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants