]> source.dussan.org Git - jgit.git/commitdiff
Fix NPE in RebaseTodoFile#parseComments 64/147864/10
authorMatthias Sohn <matthias.sohn@sap.com>
Fri, 16 Aug 2019 22:20:01 +0000 (00:20 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Mon, 19 Aug 2019 08:16:23 +0000 (10:16 +0200)
Change-Id: I5487f3c2609eaf2a0ddf71ebb2f6c9701fb7600c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/lib/RebaseTodoFile.java

index 06b4b227c8722fd1a065f76c83c69263c0c481e9..0d31851836158b6072994fc449ca0faa74242499 100644 (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