Description: The catalog function File.readLine() returns null when it encounters the first empty line in a file. The file is terminated with CRLF (0x0D, 0x0A). This causes a for next loop break on the first empty line of the input file. File.readLine() should return null only when the end of file (EOF) is reached.
Sample code:
Object sFile = File.openFile("c:/temp/file.txt");
for(String line2=File.fileReadLine(sFile); line2 != null; line2=File.fileReadLine(sFile)) {
System.debugOut(line2);
}
This terminates not when encountering the end-of-file as it should and
did with previous versions, but on the first empty line. Note that
checking line2==null is the only way to check if you encounter the
end-of-file, since there is no function like "File.isEOF()"
Symptoms: File.readLine() returns null when it encouters the first empty line in a file.
Cause: Product issue (CR BE-21025)