title: java.lang.NullPointerException at FileUploadBean.uploadFile
body: <p>I am getting <code>java.lang.NullPointerException at FileUploadBean.uploadFile</code>, not sure why as I have data in my list of string <code>fileData</code>.</p>
  
  <p><strong>Java code:</strong></p>
  
  <pre class="lang-java prettyprint-override"><code>private List&lt;String&gt; fileData;
  
  public void uploadFile(FileEntryEvent event) {
      System.out.println("Event: " + event.getSource());
      System.out.println("Test");
      FileEntry fileEntry = (FileEntry) event.getSource();
      FileEntryResults results = fileEntry.getResults();
      for (FileEntryResults.FileInfo fileInfo : results.getFiles()) {
          if (fileInfo.isSaved()) {
              System.out.println("File is saved sucessfully");
              fileData.add("FileName: " + fileInfo.getFileName());
              fileData.add("FileSize: " + fileInfo.getSize());
              fileData.add("FileStatus: " + fileInfo.getStatus());
          }
      }
  }
  
  public List&lt;String&gt; getFileData() {
      System.out.println("inside getFileData");
      List&lt;String&gt; data = fileData;
      return fileData;
  }
  
  public void setFileData(List&lt;String&gt; fileData) {
      this.fileData = fileData;
  }
  </code></pre>
  
  <p><strong>Exception:</strong></p>
  
  <pre><code>    Caused by: java.lang.NullPointerException
          at FileUploadBean.uploadFile(FileUploadBean.java:54)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.apache.el.parser.AstValue.invoke(AstValue.java:264)
          at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
          at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
          at org.icefaces.ace.component.fileentry.FileEntry.broadcast(FileEntry.java:306)
          ... 28 more
  </code></pre>