title: Error evaluating expression: Cannot invoke method getAt() on null object
body: <p>I have a Question domain model designed as follows</p>
  
  <pre><code>class Question {
  
      List&lt;Choice&gt; choiceCollection;
  
      static hasMany = [choiceCollection:Choice]
      static mappping = {
          choiceCollection(joinTable:false)
      }
  
  }
  </code></pre>
  
  <p>To fulfill my needs, /grails-app/views/question/create.gsp has been customized as you can see below</p>
  
  <p><strong>create.gsp</strong></p>
  
  <pre><code>&lt;g:each var="i" in="${(0..4)}"&gt;
      &lt;div class="fieldcontain  required"&gt;
      &lt;label for="description"&gt;
              Option ${i + 1}.
              &lt;span class="required-indicator"&gt;*&lt;/span&gt;
          &lt;/label&gt;
          &lt;g:textArea name="choiceCollection[${i}].description" cols="40" rows="5" maxlength="2000" value="${questionInstance?.choiceCollection[i]?.description}"/&gt;
      &lt;/div&gt;
  &lt;/g:each&gt;
  </code></pre>
  
  <p>When i try to access create view, <strong>i get the following error</strong></p>
  
  <pre><code>Error evaluating expression [questionInstance?.choiceCollection[i]?.description]: Cannot invoke method getAt() on null object
  </code></pre>
  
  <p>Question: What should i do to run my application ?</p>
  
  <p>Grails version: 2.1.1</p>