Skip to content

Commit

Permalink
fix NPE in R construct example (#15953)
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Jun 30, 2023
1 parent d5c53b9 commit 15b3add
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -945,10 +945,14 @@ public String constructExampleCode(CodegenParameter codegenParameter, HashMap<St
}

public String constructExampleCode(CodegenProperty codegenProperty, HashMap<String, CodegenModel> modelMaps, int depth) {
if (depth > 10) return "...";
if (depth > 10) {
return "...";
}
depth++;

if (codegenProperty.isArray) { // array
if (codegenProperty == null) {
return "TODO";
} else if (codegenProperty.isArray) { // array
return "c(" + constructExampleCode(codegenProperty.items, modelMaps, depth) + ")";
} else if (codegenProperty.isMap) { // map
return "c(key = " + constructExampleCode(codegenProperty.items, modelMaps, depth) + ")";
Expand Down

0 comments on commit 15b3add

Please sign in to comment.