Handle missing DateTime object

This commit is contained in:
Nathan Gray 2012-02-06 18:40:12 +00:00
parent 465498b36c
commit a7fd0331bd

View File

@ -351,7 +351,7 @@ class importexport_import_csv implements importexport_iface_import_record { //,
if($format == 1) if($format == 1)
{ {
$formatted = egw_time::createFromFormat(egw_time::$user_dateformat, $record[$name]); $formatted = egw_time::createFromFormat(egw_time::$user_dateformat, $record[$name]);
if($errors = egw_time::getLastErrors() && $errors['error_count'] == 0) if($formatted && $errors = egw_time::getLastErrors() && $errors['error_count'] == 0)
{ {
$record[$name] = $formatted->getTimestamp(); $record[$name] = $formatted->getTimestamp();
} }