Skip to content

Commit

Permalink
Fix possible NPE in AbstractApplication as seen in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
laeubi committed Nov 7, 2023
1 parent 825bee3 commit 270938c
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,19 @@ public IArtifactRepository getCompositeArtifactRepository() {
}

public boolean hasArtifactSources() {
return ((ICompositeRepository<?>) getCompositeArtifactRepository()).getChildren().size() > 0;
IArtifactRepository repository = getCompositeArtifactRepository();
if (repository instanceof ICompositeRepository<?> composite) {
return composite.getChildren().size() > 0;
}
return false;
}

public boolean hasMetadataSources() {
return ((ICompositeRepository<?>) getCompositeMetadataRepository()).getChildren().size() > 0;
IMetadataRepository repository = getCompositeMetadataRepository();
if (repository instanceof ICompositeRepository<?> composite) {
return composite.getChildren().size() > 0;
}
return false;
}

public abstract IStatus run(IProgressMonitor monitor) throws ProvisionException;
Expand Down

0 comments on commit 270938c

Please sign in to comment.