Skip to content

RequestBody changes with metadata only changes (i.e. description) causes nullpointer exception #64

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

Closed
jinta opened this issue Feb 19, 2019 · 1 comment
Labels

Comments

@jinta
Copy link

jinta commented Feb 19, 2019

When specifiying a Markdown file output and only changing the description under a requestBody the application fails with a NullPointerException in this bit of code

if (operation.resultRequestBody().isDifferent()) {
  details
           .append(titleH5("Request:"))
           .append(bodyContent(operation.getRequestBody().getContent()));
}

It recognises the operation to have changed but the content of the getRequestBody is null in this scenario.

A potential fix is to have a null check in the bodyContent method i.e.:

protected String bodyContent(String prefix, ChangedContent changedContent){
  if (changedContent == null) {
    return ""; // or prefix?
  }
  ...
}
@quen2404
Copy link
Member

Hello @jinta ! Thank your for the issue. Fixed with PR #65

@quen2404 quen2404 added the bug label Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants