Browse Source

Fix NPE in RebaseTodoFile#parseComments

Change-Id: I5487f3c2609eaf2a0ddf71ebb2f6c9701fb7600c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-5.1
Matthias Sohn 5 years ago
parent
commit
86a567f615
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java

2
org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java

@ -137,12 +137,14 @@ public class RebaseTodoFile {
if (skip != -1) {
// try to parse the line as non-comment
line = parseLine(buf, skip, lineEnd);
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
line = null;

Loading…
Cancel
Save