Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2019-08-16 22:20:01 +0000
committerMatthias Sohn2019-08-19 08:16:23 +0000
commit86a567f6152315f5d55309c7119885d0fa3476ce (patch)
treeab326c0514e106b42721aa53b512d032eca0ddb3
parenta4216e5382026ff9956af82322c7c5af24e0f245 (diff)
downloadjgit-86a567f6152315f5d55309c7119885d0fa3476ce.tar.gz
jgit-86a567f6152315f5d55309c7119885d0fa3476ce.tar.xz
jgit-86a567f6152315f5d55309c7119885d0fa3476ce.zip
Fix NPE in RebaseTodoFile#parseComments
Change-Id: I5487f3c2609eaf2a0ddf71ebb2f6c9701fb7600c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java
index 06b4b227c8..0d31851836 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java
@@ -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

Back to the top