Merge "Skip replay inline comments for revisions that do not exist in source" into stable-2.11
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 7ce0212..ec85a3a 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/importer/ReplayInlineCommentsStep.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/importer/ReplayInlineCommentsStep.java
@@ -125,6 +125,14 @@
}
comments = filterComments(ps, comments);
+ } else if (comments == null) {
+ log.warn(String.format(
+ "[%s] Cannot retrieve comments for revision %s, "
+ + "revision not found in source system: "
+ + "Skip replay inline comments for patch set %s of project %s.",
+ pluginName, ps.getRevision().get(), ps.getId().toString(),
+ change.getProject().get()));
+ continue;
}
Multimap<Account.Id, CommentInfo> commentsByAuthor = ArrayListMultimap.create();