title: .iterator() Producing Null Pointer Exception Even When Checked For Null
body: <p>I am doing some threading. In the postExecute I need to perform an iterator task. I check if the iterator() is null, but it's still producing this error:</p>
  
  <pre><code>java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
          at co.appname.app.Fragments.F_EditPhoto$FiltersAsyncTask.onPostExecute(F_EditPhoto.java:772)
  </code></pre>
  
  <p>Here is my code, Im checking for what I think is every possible null scenario. Can you advise what I am doing wrong?</p>
  
  <pre><code>@Override
          protected void onPostExecute(Void aVoid)
          {
              List&lt;K_FilterPreview&gt; filtersCache = _positionToFiltersCacheMap.get(_selectedEditImage.position);
              if (filtersCache == null || filtersCache.iterator() == null)
              {
                  System.err.println("Filter cache was null");
              }
  
              // THIS IS THE LINE THROWING THE ERROR!
              Iterator&lt;K_FilterPreview&gt; i = filtersCache.iterator();
              while (i.hasNext())
              {
                  //Do stuff
              }
          }
  </code></pre>
  
  <p>This only occurs if I try to start this event as soon as the current event is done processing. If I wait a few seconds before invoking this it works fine. So there is something going on with the threading but I'm not sure what.</p>