Skip to content

Commit

Permalink
fix null pointer error
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Dec 7, 2020
1 parent cdf09af commit a6c014d
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,13 @@ private void readResources(Document document) {

if (method.request() != null) {
Message request = allMessages.get(method.request().reference());
String requestFieldName =
Name.anyCamel(request.getName(), "resource").toLowerUnderscore();
input.getFields().add(new Field(requestFieldName, request, false, null, null));
methodHttpOption.getProperties().put("body", requestFieldName);
methodSignatureParamNames.put("", requestFieldName);
if (request != null) {
String requestFieldName =
Name.anyCamel(request.getName(), "resource").toLowerUnderscore();
input.getFields().add(new Field(requestFieldName, request, false, null, null));
methodHttpOption.getProperties().put("body", requestFieldName);
methodSignatureParamNames.put("", requestFieldName);
}
}

Option requiredMethodSignatureOption = new Option("google.api.method_signature");
Expand Down

0 comments on commit a6c014d

Please sign in to comment.