Skip to content

Commit fb7f0ac

Browse files
author
FAREAST\vidadhee
committed
Have put a check for null values of function/action parameters in Method Collection Request Builder classes
1 parent 99c8390 commit fb7f0ac

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Templates/Java/requests_generated/BaseMethodCollectionRequestBuilder.java.tt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020
super(requestUrl, client, requestOptions);
2121
<# foreach (var p in method.Parameters) { #>
2222
<# if (isAction) { #>
23-
bodyParams.put("<#=ParamName(p)#>", <#=ParamName(p)#>);
23+
if(<#=ParamName(p)#>!=null){
24+
bodyParams.put("<#=ParamName(p)#>", <#=ParamName(p)#>);
25+
}
2426
<# } else { #>
25-
functionOptions.add(new FunctionOption("<#=ParamName(p)#>", <#=ParamName(p)#>));
27+
if(<#=ParamName(p)#>!=null){
28+
functionOptions.add(new FunctionOption("<#=ParamName(p)#>", <#=ParamName(p)#>));
29+
}
2630
<# } #>
2731
<# } #>
2832
}

0 commit comments

Comments
 (0)