Skip to content

Commit

Permalink
Issue #5133 - Fixing ResourceCollection(String) when no entries provi…
Browse files Browse the repository at this point in the history
…ded.

Signed-off-by: Joakim Erdfelt <[email protected]>
  • Loading branch information
joakime committed Aug 20, 2020
1 parent f881a1a commit b35c433
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,18 @@ public void setResourcesAsCSV(String csvResources) throws IOException
throw new IllegalArgumentException("CSV String is blank");
}

List<Resource> res = new ArrayList<>();
for (Resource resource : Resource.fromList(csvResources, false))
List<Resource> resources = Resource.fromList(csvResources, false);
if (resources.isEmpty())
{
throw new IllegalArgumentException("CSV String contains no entries");
}
List<Resource> ret = new ArrayList<>();
for (Resource resource : resources)
{
assertResourceValid(resource);
res.add(resource);
ret.add(resource);
}
setResources(res);
setResources(ret);
}

/**
Expand Down

0 comments on commit b35c433

Please sign in to comment.