package com.hubspot.baragon.agent.handlebars;

import java.io.IOException;
import java.util.List;

import com.github.jknack.handlebars.Options;

public class IfContainedInHelperSource {

  public static CharSequence ifContainedIn(List<String> haystack, String needle, Options options) throws IOException {
    for (String element : haystack) {
      if (element.contains(needle)) {
        return options.fn();
      }
    }

    return options.inverse();
  }

}

@@ -90,16 +90,42 @@
 il.List;
+%0Aimport java.util.Objects;
 %0A%0Aimport
@@ -325,16 +325,91 @@
 ption %7B%0A
+    if (Objects.isNull(haystack)) %7B%0A      return options.inverse();%0A    %7D%0A%0A
     for 

Add null check for haystack arg.