Handle file comment File comment doesn't have line number and its location is at line 0. Currently the code will have NPE when there's a file comment in the review. Change-Id: I577f243572d91837529bbc55aeb3f290496f5e4e Signed-off-by: Ardo Septama <aseptama@gmail.com>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/importer/ReplayInlineCommentsStep.java b/src/main/java/com/googlesource/gerrit/plugins/importer/ReplayInlineCommentsStep.java index 1de5473..8fabda0 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/importer/ReplayInlineCommentsStep.java +++ b/src/main/java/com/googlesource/gerrit/plugins/importer/ReplayInlineCommentsStep.java
@@ -210,7 +210,7 @@ c.range.endCharacter)); e.lineNbr = c.range.endLine; } else { - e.lineNbr = c.line; + e.lineNbr = c.line == null ? 0 : c.line; } ups.add(e); }