diff options
-rw-r--r-- | tools/source/datetime/tdate.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx index 46e5ad62469e..9815716ebe3f 100644 --- a/tools/source/datetime/tdate.cxx +++ b/tools/source/datetime/tdate.cxx @@ -464,6 +464,8 @@ bool Date::IsValidDate() const //static bool Date::IsValidDate( sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear ) { + if (nYear == 0) + return false; if ( !nMonth || (nMonth > 12) ) return false; if ( !nDay || (nDay > ImplDaysInMonth( nMonth, nYear )) ) |