Skip to content

Commit

Permalink
Fix NPE in case there are no not found files (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
vibe13 authored Sep 3, 2024
1 parent 7f40032 commit 31e4826
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,16 @@ private static Set<Artifact> getNotFoundArtifacts(Map<BuildSystemInteger, KojiBu
}

KojiBuild buildZero = builds.get(new BuildSystemInteger(0));
List<KojiLocalArchive> localArchives = buildZero.getArchives();
int numArchives = localArchives.size();
if (buildZero == null) {
return Collections.unmodifiableSet(new LinkedHashSet<>());
}

if (numArchives == 0) {
List<KojiLocalArchive> localArchives = buildZero.getArchives();
if (localArchives == null || localArchives.size() == 0) {
return Collections.unmodifiableSet(new LinkedHashSet<>());
}

int numArchives = localArchives.size();
Set<Artifact> artifacts = new LinkedHashSet<>(numArchives);
int archiveCount = 0;

Expand Down

0 comments on commit 31e4826

Please sign in to comment.