title: Iterating over a map of Object: List in Freemarker
body: <p>I'm trying to iterate in a freemarker template over a <code>HashMap&lt;SeapSubscription, List&lt;PiNotice&gt;&gt;</code>.
  The map doesn't contain any nulls (in keys or values).</p>
  
  <p>The code in Freemarker is:</p>
  
  <pre><code> &lt;#list subscriptionsWithPiNotices?keys as s&gt;
   ${s.title}
  
      &lt;#list subscriptionsWithPiNotices[s] as piNotice&gt;
      Autoritate contractanta: ${piNotice.contractingAuthorityName}
      .
      .
      &lt;/#list&gt;
  &lt;/#list&gt;
  </code></pre>
  
  <p>If I remove the iteration from the second list (&lt;#list subscriptionsWithPiNotices[s] as piNotice>) it all works (that is iterating over the map keys, but when I add the second part, trying to iterate over the map-s value, i get a Null / missing exception</p>
  
  <blockquote>
  <pre><code>                           FreeMarker template error: The following has evaluated to null or missing:
  </code></pre>
    
    <p>==> subscriptionsWithPiNotices[s]  [in template "seap-subscription-newsletter.ftl" at line 21, column 16]</p>
    
    <p>Tip: If the failing expression is known to be legally null/missing,
    either specify a default value with myOptionalVar!myDefault, or use
    &lt;#if myOptionalVar??>when-present&lt;#else>when-missing. (These
    only cover the last step of the expression; to cover the whole
    expression, use parenthessis: (myOptionVar.foo)!myDefault,
    (myOptionVar.foo)??</p>
    
    <p>The failing instruction (FTL stack trace):</p>
    
    <p>==> #list subscriptionsWithPiNotices[s] a...  [in template "seap-subscription-newsletter.ftl" at line 21, column 9]
        #list subscriptionsWithPiNotices?keys...  [in template "seap-subscription-newsletter.ftl" at line 18, column 5]</p>
  </blockquote>
  
  <p>I repeat, I dumped that HashMap, and it only has one key with one ArrayList having one item inside. So there's no reason to report a null, is it ?</p>