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) { if (skip != -1) {
// try to parse the line as non-comment // try to parse the line as non-comment
line = parseLine(buf, skip, lineEnd); line = parseLine(buf, skip, lineEnd);
if (line != null) {
// successfully parsed as non-comment line // successfully parsed as non-comment line
// mark this line as a comment explicitly // mark this line as a comment explicitly
line.setAction(Action.COMMENT); line.setAction(Action.COMMENT);
// use the read line as comment string // use the read line as comment string
line.setComment(commentString); line.setComment(commentString);
} }
}
} catch (Exception e) { } catch (Exception e) {
// parsing as non-comment line failed // parsing as non-comment line failed
line = null; line = null;

Loading…
Cancel
Save