Skip to content

Commit 5aa112a

Browse files
merkslaeubi
authored andcommitted
Prevent NPE in ApiBaseline.getApiComponent(String, Version)
- Guard against fAllComponentsById.get(id) yielding null. #1569
1 parent 5d46304 commit 5aa112a

File tree

1 file changed

+3
-0
lines changed
  • apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model

1 file changed

+3
-0
lines changed

apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/model/ApiBaseline.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,9 @@ public IApiComponent getApiComponent(String id, Version version) {
674674
return component;
675675
}
676676
Set<IApiComponent> allComponents = fAllComponentsById.get(id);
677+
if (allComponents == null) {
678+
return null;
679+
}
677680
return allComponents.stream().filter(c -> hasSameMMMVersion(version, c)).findFirst().orElse(null);
678681
}
679682

0 commit comments

Comments
 (0)