コンテキスト:空白のExcelセルの長さをチェックするときにNULLポインタ例外がスローされます。空白のExcelセルの長さをチェックするときにJava Nullポインタ例外がスローされる
例外を修正するのを手伝ってください。
int lastRowNum = sh.getLastRowNum();
for (int i = 1; i < (lastRowNum+1); i++) {
Row row = sh.getRow(i);
System.out.println(i);
// Null pointer exception throws for below if condition
if (row.getCell(0).toString().length() == 0) {
actions.operations(objectRepository, row.getCell(1).toString(), row.getCell(2).toString(), row.getCell(3).toString(), row.getCell(4).toString());
}
else {
System.out.println("Test Case: " + row.getCell(0).toString() + " Started");
}
}
[NullPointerExceptionがある、と私はそれをどのように修正すればよいか?](http://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-の可能性のある重複i-fix-it) –