diff options
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/commontools/dbconversion.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx index 6a2e21191fa4..e7df86d39215 100644 --- a/connectivity/source/commontools/dbconversion.cxx +++ b/connectivity/source/commontools/dbconversion.cxx @@ -377,6 +377,14 @@ namespace dbtools css::util::DateTime DBTypeConversion::toDateTime(const double dVal, const css::util::Date& _rNullDate) { + css::util::DateTime aRet; + + if (!std::isfinite(dVal)) + { + SAL_WARN("connectivity.commontools", "DateTime has invalid value: " << dVal); + return aRet; + } + css::util::Date aDate = toDate(dVal, _rNullDate); // there is not enough precision in a double to have both a date // and a time up to nanoseconds -> limit to microseconds to have @@ -384,8 +392,6 @@ namespace dbtools // 12:59:59.999999790 css::util::Time aTime = toTime(dVal, 6); - css::util::DateTime aRet; - aRet.Day = aDate.Day; aRet.Month = aDate.Month; aRet.Year = aDate.Year; |