Fix possible NPE reported by FindBugs.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1495269 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2013-06-21 01:49:03 +00:00
parent 93a07b9b8f
commit 530b038269
1 changed files with 7 additions and 1 deletions

View File

@ -86,7 +86,13 @@ final class CSVLexer extends Lexer {
}
if (isStartOfLine(lastChar) && isCommentStart(c)) {
final String comment = in.readLine().trim();
String line = in.readLine();
if (line == null) {
token.type = EOF;
// don't set token.isReady here because no content
return token;
}
final String comment = line.trim();
token.content.append(comment);
token.type = COMMENT;
return token;