mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
Handle possible invalid date value (#61652)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1855627 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8225326b56
commit
ee83ce5fcd
@ -45,6 +45,9 @@ public class EDate implements FreeRefFunction {
|
||||
int offsetInMonthAsNumber = (int) getValue(args[1]);
|
||||
|
||||
Date startDate = DateUtil.getJavaDate(startDateAsNumber);
|
||||
if (startDate == null) {
|
||||
return ErrorEval.VALUE_INVALID;
|
||||
}
|
||||
Calendar calendar = LocaleUtil.getLocaleCalendar();
|
||||
calendar.setTime(startDate);
|
||||
calendar.add(Calendar.MONTH, offsetInMonthAsNumber);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user