Skip replay inline comments for revisions that do not exist in source

It should not happen that the ChangeInfo received from the source
system contains a revision that cannot be found in the source system
when retrieving inline comments from the source system. Still we don't
want to fail in this case, but rather skip replaying the inline
comments for this revision.

Change-Id: Ic7dbf26472d28658dfdda44487811384d9237899
Signed-off-by: Edwin Kempin <edwin.kempin@sap.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 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();