Skip to content

Commit e8f6df9

Browse files
authored
Merge pull request #8297 from swagger-api/authmethods-npe
fixed NPE on `getHasQueryParams` method.
2 parents 6862cdd + 9dcfe40 commit e8f6df9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenOperation.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ public boolean getHasQueryParams() {
7171
return true;
7272
}
7373

74+
if (authMethods == null || authMethods.isEmpty()) {
75+
return false;
76+
}
77+
7478
// Check if one of the authMethods is a query param
7579
for (CodegenSecurity sec : authMethods) {
7680
if (sec.isKeyInQuery) {

0 commit comments

Comments
 (0)