Here at the line while((anInt=bufferedReader.read())!=-1)
iam getting Null Dereference
issue when i do my XSS validation on the below code. For this is this enough to check not null or do we have any other check or solution to resolve this..
BufferedReader bufferedReader = null;
try {
bufferedReader = new BufferedReader(new FileReader(new File (url.toURI())));
} catch (Exception e) {
e.printStackTrace();
}
response.setContentType("text/plain");
try{
int anInt=0;
//if(!bufferedReader.equals(null)){
while((anInt=bufferedReader.read())!=-1)
response.getWriter().write(anInt);
//}
} catch(IOException ioe) { }
return null;
Commented the if condition..