Browse Source

Fix NPE in RebaseTodoFile#parseComments

Change-Id: I5487f3c2609eaf2a0ddf71ebb2f6c9701fb7600c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tags/v5.1.9.201908210455-r
Matthias Sohn 4 years ago
parent
commit
86a567f615
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java

+ 7
- 5
org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java View File

@@ -137,11 +137,13 @@ public class RebaseTodoFile {
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

Loading…
Cancel
Save