From 96d3004ed71dc050333ad7320c35d8bc524227c0 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Sat, 5 Apr 2008 18:01:05 +0000 Subject: Tweak DateUtil, an add cell content fetching to the quick guide documentation git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@645150 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/ss/usermodel/DateUtil.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/java/org/apache/poi/ss') diff --git a/src/java/org/apache/poi/ss/usermodel/DateUtil.java b/src/java/org/apache/poi/ss/usermodel/DateUtil.java index ad3ba25d83..9335de35da 100644 --- a/src/java/org/apache/poi/ss/usermodel/DateUtil.java +++ b/src/java/org/apache/poi/ss/usermodel/DateUtil.java @@ -280,6 +280,8 @@ public class DateUtil double d = cell.getNumericCellValue(); if ( DateUtil.isValidExcelDate(d) ) { CellStyle style = cell.getCellStyle(); + if(style == null) return false; + int i = style.getDataFormat(); String f = style.getDataFormatString(); bDate = isADateFormat(i, f); -- cgit v1.2.3