I got Fortify findings back and I'm getting a null dereference. I think I know why I'm getting it , just wanted to know what would be the best way to fix the issue. Here is a code snippet:
public class Example{
private Collection<Auth> Authorities;
public Example(SomeUser user){
for(String role: user.getAuth()){ //This is where Fortify gives me a null dereference
Authorities.add(new Auth(role));
}
}
private List<String> getAuth(){
return null;
}
}