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
(cherry picked from commit 270938c)
  • Loading branch information
laeubi committed Nov 8, 2023
1 parent b2797bc commit 6c1d589
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 6c1d589

Please sign in to comment.