diff --git a/BaragonAgentService/src/main/java/com/hubspot/baragon/agent/handlebars/IfContainedInHelperSource.java b/BaragonAgentService/src/main/java/com/hubspot/baragon/agent/handlebars/IfContainedInHelperSource.java index 747e8e70f..3468f8005 100644 --- a/BaragonAgentService/src/main/java/com/hubspot/baragon/agent/handlebars/IfContainedInHelperSource.java +++ b/BaragonAgentService/src/main/java/com/hubspot/baragon/agent/handlebars/IfContainedInHelperSource.java @@ -2,12 +2,17 @@ import java.io.IOException; import java.util.List; +import java.util.Objects; import com.github.jknack.handlebars.Options; public class IfContainedInHelperSource { public static CharSequence ifContainedIn(List haystack, String needle, Options options) throws IOException { + if (Objects.isNull(haystack)) { + return options.inverse(); + } + for (String element : haystack) { if (element.contains(needle)) { return options.fn();