Protect the TrackingFooters.extract from null input parameter
Some code paths could pass null to the TrackingFooters.extract. An example is [1] which happens when loading of the current patch set of a change fails. [1] at com.google.gerrit.server.config.TrackingFooters.extract(TrackingFooters.java:42) at com.google.gerrit.server.query.change.OutputStreamQuery.query(OutputStreamQuery.java:247) ... Change-Id: I27ce4cc0d9606208a8be884646e901004171bd96
This commit is contained in:
@@ -39,6 +39,10 @@ public class TrackingFooters {
|
||||
|
||||
public Multimap<String, String> extract(List<FooterLine> lines) {
|
||||
Multimap<String, String> r = ArrayListMultimap.create();
|
||||
if (lines == null) {
|
||||
return r;
|
||||
}
|
||||
|
||||
for (FooterLine footer : lines) {
|
||||
for (TrackingFooter config : trackingFooters) {
|
||||
if (footer.matches(config.footerKey())) {
|
||||
|
||||
Reference in New Issue
Block a user