Skip to content

Commit

Permalink
fix issue with path null #9
Browse files Browse the repository at this point in the history
Signed-off-by: olivier lamy <[email protected]>
  • Loading branch information
olamy committed Feb 21, 2017
1 parent bbc1579 commit 188a078
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public Resource( String path, List<Resource> then )

public Resource path( String path )
{
this.path = StringUtil.startsWithIgnoreCase( path, "/" ) ? path : "/" + path;
this.path = path !=null ? StringUtil.startsWithIgnoreCase( path, "/" ) ? path : "/" + path : null;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ private Collection<String> paths( Resource profile )
{
Set<String> paths = new HashSet<>();

if (profile.getPath() != null)
{
paths.add( profile.getPath() );
}

for ( Resource resource : profile.getResources() )
{
paths.addAll( paths( resource ) );
Expand Down

0 comments on commit 188a078

Please sign in to comment.