Skip to content

Commit

Permalink
Merge pull request #3304 from springfox/bugfix/model-enhancement
Browse files Browse the repository at this point in the history
Check to prevent NPE. #3303
  • Loading branch information
dilipkrish authored May 6, 2020
2 parents 4c181b6 + 500ddcf commit e136026
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ private Set<String> findSameModels(
for (ModelReference modelReference : rootModel.getSubTypes()) {
Optional<String> modelId = getModelId(modelReference);

if (modelId.isPresent()) {
if (modelId.isPresent() && mergingContext.containsModel(modelId.get())) {
String sModelId = modelId.get();
ModelContext modelContext = Optional.ofNullable(parametersMatching.get(sModelId))
.map(op -> op.orElseGet(() -> parameter))
Expand All @@ -311,7 +311,7 @@ private Set<String> findSameModels(
ModelReference modelReference = property.getModelRef();
Optional<String> modelId = getModelId(modelReference);

if (modelId.isPresent()) {
if (modelId.isPresent() && mergingContext.containsModel(modelId.get())) {
String sModelId = modelId.get();
ModelContext modelContext = Optional.ofNullable(parametersMatching.get(sModelId))
.map(op -> op.orElseGet(() -> parameter))
Expand Down

0 comments on commit e136026

Please sign in to comment.