title: Method that returns null is causing java.lang.NullPointerException
body: <p>I wrote this method:</p>
  
  <pre><code>@Override
      protected String call() {
          if (list != null) {
              int s = list.size();
              Metadata metadata;
              for (int i = 0; i &lt; s; i++) {
                  try {
                      File f = list.get(i);
                      metadata = ImageMetadataReader.readMetadata(f);
                      // obtain the Exif directory
                      ExifSubIFDDirectory directory = metadata.getDirectory(ExifSubIFDDirectory.class);
                      // query the tag's value
                      Date date = directory.getDate(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL);
                      if (date != null) {
                          SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                          System.out.println("File: " + f.getAbsolutePath() + "\tDATETIME_ORIGINAL: " + sdf.format(date));
                      } else {
                          System.out.println("File: " + f.getAbsolutePath() + "\tDATETIME_ORIGINAL: no data!");
                      }
  
                  } catch (Exception ex) {
                      ex.printStackTrace();
                      System.out.println("Error: " + ex.getLocalizedMessage());
                  } finally {
                      updateProgress(i + 1, s);
                  }
              }
          }
          return null;
      }
  </code></pre>
  
  <p>Method directory.getDate(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL) can sometimes return null:
  <a href="https://code.google.com/p/metadata-extractor/source/browse/Source/com/drew/metadata/Directory.java?r=efcf135e5cb7b9947812054acd845048f0b0ef9e#723" rel="nofollow">Source</a></p>
  
  <p>Problem is that by just calling that method java throws Null Pointer Exception, so I cannot test it with date!=null. NetBeans also reports "Dereferencing possible null pointer" hint. I do not understand why this happens. Why I'm not able to store null value in some object and test it? Even if I don't store value in variable, that method still causes the same exception when returning null.</p>