commit | a360605010c963fbe2c834efbafacea3d4725673 | [log] [tgz] |
---|---|---|
author | Ardo Septama <aseptama@gmail.com> | Tue Nov 21 15:00:46 2017 +0100 |
committer | Ardo Septama <aseptama@gmail.com> | Tue Nov 21 16:07:39 2017 +0100 |
tree | bd2417402014538117907de5eb3fd96a1eb52244 | |
parent | 93182ec3d82b6c2a217792c6aec806a06d3c3203 [diff] |
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); }