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. 12
      org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java

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

@ -137,11 +137,13 @@ 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);
// successfully parsed as non-comment line if (line != null) {
// mark this line as a comment explicitly // successfully parsed as non-comment line
line.setAction(Action.COMMENT); // mark this line as a comment explicitly
// use the read line as comment string line.setAction(Action.COMMENT);
line.setComment(commentString); // use the read line as comment string
line.setComment(commentString);
}
} }
} catch (Exception e) { } catch (Exception e) {
// parsing as non-comment line failed // parsing as non-comment line failed

Loading…
Cancel
Save