Skip to content

Commit a989c2a

Browse files
author
tjaneczko
committed
Fix NullPointerException when resolving an ApiResponse with no content
1 parent 911d018 commit a989c2a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/ResolverCache.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ else if(rootPath != null) {
159159
protected <T> void updateLocalRefs(String file, T result) {
160160
if(result instanceof ApiResponse) {
161161
ApiResponse response = (ApiResponse) result;
162-
for(String mediaType : response.getContent().keySet()) {
163-
updateLocalRefs(file, response.getContent().get(mediaType).getSchema());
162+
if (response.getContent() != null) {
163+
for (String mediaType : response.getContent().keySet()) {
164+
updateLocalRefs(file, response.getContent().get(mediaType).getSchema());
165+
}
164166
}
165167
}
166168
if(result instanceof Schema && ((Schema)(result)).get$ref() != null) {

0 commit comments

Comments
 (0)