better handling of null pointer in CodegenSecurity (#16433)

This commit is contained in:
William Cheng
2023-08-29 13:33:35 +08:00
committed by GitHub
parent 56105fbbe6
commit 1a654eba5c

View File

@@ -89,6 +89,10 @@ public class CodegenSecurity {
public CodegenSecurity filterByScopeNames(List<String> filterScopes) {
CodegenSecurity filteredSecurity = new CodegenSecurity(this);
if (scopes == null) {
return filteredSecurity;
}
List<Map<String, Object>> returnedScopes = new ArrayList<Map<String, Object>>();
Map<String, Object> lastScope = null;
for (String filterScopeName : filterScopes) {