commit | 6bff66dac4f9ad7e81d3e08d997285176d8edf8c | [log] [tgz] |
---|---|---|
author | Martin Fick <mfick@codeaurora.org> | Thu May 07 13:21:39 2020 -0600 |
committer | Nasser Grainawi <nasser@codeaurora.org> | Fri May 08 23:08:21 2020 +0000 |
tree | 86c01100b52aa99caeedb9bf298dde2a09f58dfa | |
parent | ef028220da5c9fc185b840e35d43e86bf7adb380 [diff] |
Fix NPE in PushResultProcessing The PushOne code passes a null to the notifier on cleanup when it encounters unknown states and this null gets passed all the way to PushResultProcessing which previously would NPE on it. Handle the null by outputting an "unknown" instead of crashing. Change-Id: I107d964a33349aaa5d6ae9aca68aab2889689155
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java b/src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java index 39d361f..8542034 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/PushResultProcessing.java
@@ -127,7 +127,7 @@ break; } sb.append(" ("); - sb.append(refStatus.toString()); + sb.append(refStatus == null ? "unknown" : refStatus.toString()); sb.append(")"); writeStdOut(sb.toString()); }