ReplicationQueue: Add handling of null ReplicationTasksStorage.ReplicateRefUpdate

This was originally done in change I72f34d8de but got lost in
the merge from stable-2.15 to stable-2.16 in change Icc855dd26.

Change-Id: Iea4d6e80f64d84b9c13a9fb1792e84fec808a237
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java b/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java
index ca8001a..4a59d70 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationQueue.java
@@ -196,6 +196,10 @@
       Set<String> eventsReplayed = new HashSet<>();
       replaying = true;
       for (ReplicationTasksStorage.ReplicateRefUpdate t : replicationTasksStorage.list()) {
+        if (t == null) {
+          repLog.atWarning().log("Encountered null replication event in ReplicationTasksStorage");
+          continue;
+        }
         String eventKey = String.format("%s:%s", t.project, t.ref);
         if (!eventsReplayed.contains(eventKey)) {
           repLog.atInfo().log("Firing pending task %s", eventKey);