title: Adobe Air: why does this DataProvider create error?
body: <p>I am currently getting an error at line 148 during runtime:</p>
  
  <pre><code>TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at PlantDB/ResultFill()[C:\Users\usern\Adobe Flash Builder 4.6\PlantDB\src\SQLiteCode.as:148]
  </code></pre>
  
  <p>The code at line 148 is:</p>
  
  <pre><code>leftList.dataProvider = new ArrayCollection(arr);
  </code></pre>
  
  <p>Before coming to this line 148, the program has checked that Array arr is not null with if (arr != null), so I am 100% sure that arr is not null. </p>
  
  <p>The content of arr is from sqlite:</p>
  
  <pre><code>arr = sqls.getResult().data;
  </code></pre>
  
  <p>There are several objects in the database, and I see that I can get the content from the database just fine. In fact, before line 148, I've checked the content inside arr by:</p>
  
  <pre><code>var tree:TreeClass_Full = arr[0]; 
  </code></pre>
  
  <p>In the debugger, I checked the tree object above, and I see that all variables from the sqlite database are transferred to the tree object correctly. In fact, I've checked arr[1], arr[2], etc. as well, and I see that the objects got correct data.</p>
  
  <p>In my opinion, sqlite and all that do not seem to be a problem, but when I add this Array arr to var tree:TreeClass_Full = arr[0];, the error pops out.</p>
  
  <p>I don't get it. Cannot access a property or method of a null object reference? What are the hidden process in dataProvider that causes this error? </p>
  
  <p>My leftList is here:</p>
  
  <pre><code>        &lt;s:HGroup width="100%" height="85%" verticalAlign="middle"&gt;
              &lt;s:List id = "leftList" width = "45%" height = "95%"
                      dragEnabled="true" dragMoveEnabled="true" dropEnabled="true"
                      itemRenderer="resultRenderer"/&gt;
              &lt;s:List id = "rightList" width = "45%" height = "95%" 
                      dragEnabled="true" dragMoveEnabled="true" dropEnabled="true" 
                      itemRenderer="resultRenderer"/&gt;
          &lt;/s:HGroup&gt;
  </code></pre>
  
  <p>and my itemRenderer (resultRenderer) is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                  xmlns:s="library://ns.adobe.com/flex/spark" 
                  xmlns:mx="library://ns.adobe.com/flex/mx" 
                  autoDrawBackground="true"&gt;
      &lt;s:HGroup x="5" y="5" width="350" height="150" horizontalAlign="center" verticalAlign="middle"&gt;
           &lt;mx:Image id = "resultImage" width="100" height="100"/&gt; 
           &lt;s:TextArea id="resultTextArea" height="141" editable="false"
                      text = "{data.Common_Name}"/&gt; 
      &lt;/s:HGroup&gt;
  &lt;/s:ItemRenderer&gt;
  </code></pre>
  
  <p>If anybody knows what causes this error during dataProvider, please help.</p>