This is what I have done, code looks like below :
CSVReader reader = new CSVReader(new FileReader("fileName.csv"), ',' , '"' , 1); // using openCSV
String[] nextLine; // Declaring the array
while ((nextLine = reader.readNext()) != null) {
if (nextLine != null) {
if(nextLine[10] == null){
/*CODE*/ // Error at the if condition line.
}
}
}