https://issues.apache.org/bugzilla/show_bug.cgi?id=57512

            Bug ID: 57512
           Summary: Patch for NullPointerException at
                    org.apache.poi.ss.usermodel.DateUtil.getJavaDate(DateU
                    til.java:231) ~[poi-3.11.jar:3.11]
           Product: POI
           Version: 3.11-FINAL
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
          Assignee: [email protected]
          Reporter: [email protected]

in org.apache.poi.ss.usermodel.DateUtil, the method getJavaCalendar() may
return null, which will cause a NullPointerException in getJavaDate().

Buggy version of getJavaDate():
  public static Date getJavaDate(double date, boolean use1904windowing) {
        return getJavaCalendar(date, use1904windowing, null, false).getTime();
    }

Fixed Version of getJavaDate():

  public static Date getJavaDate(double date, boolean use1904windowing) {
      Calendar c = getJavaCalendar(date, use1904windowing, null, false);
      return c == null ? null : c.getTime();
  }

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to