From 8a53eea50483ac9e31e73028ce707b26aa2e9632 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 27 Nov 2015 10:09:10 +0100 Subject: [PATCH] Fix quality flaws --- .../src/main/java/org/sonar/search/script/ListUpdate.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- 2.39.5