Fix NPE in RebaseTodoFile#parseComments

Change-Id: I5487f3c2609eaf2a0ddf71ebb2f6c9701fb7600c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2019-08-17 00:20:01 +02:00
parent a4216e5382
commit 86a567f615
1 changed files with 7 additions and 5 deletions

View File

@ -137,11 +137,13 @@ private static void parseComments(byte[] buf, int tokenBegin,
if (skip != -1) {
// try to parse the line as non-comment
line = parseLine(buf, skip, lineEnd);
// successfully parsed as non-comment line
// mark this line as a comment explicitly
line.setAction(Action.COMMENT);
// use the read line as comment string
line.setComment(commentString);
if (line != null) {
// successfully parsed as non-comment line
// mark this line as a comment explicitly
line.setAction(Action.COMMENT);
// use the read line as comment string
line.setComment(commentString);
}
}
} catch (Exception e) {
// parsing as non-comment line failed