From: Simon Brandhof Date: Fri, 27 Nov 2015 09:09:10 +0000 (+0100) Subject: Fix quality flaws X-Git-Tag: 5.3-RC1~147 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8a53eea50483ac9e31e73028ce707b26aa2e9632;p=sonarqube.git Fix quality flaws --- diff --git a/server/sonar-search/src/main/java/org/sonar/search/script/ListUpdate.java b/server/sonar-search/src/main/java/org/sonar/search/script/ListUpdate.java index d93ae29b515..aad18588ed8 100644 --- a/server/sonar-search/src/main/java/org/sonar/search/script/ListUpdate.java +++ b/server/sonar-search/src/main/java/org/sonar/search/script/ListUpdate.java @@ -19,6 +19,7 @@ */ package org.sonar.search.script; +import java.util.Objects; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.xcontent.support.XContentMapValues; import org.elasticsearch.script.AbstractExecutableScript; @@ -125,7 +126,8 @@ public class ListUpdate extends AbstractExecutableScript { break; } } - if (target != null) { + if (target != null && items != null) { + items.remove(target); }