diff --git a/utils/xmlimport.php b/utils/xmlimport.php index cecd7c3e0..7cd650d03 100644 --- a/utils/xmlimport.php +++ b/utils/xmlimport.php @@ -811,11 +811,11 @@ function insert_document($document) { /* {{{ */ $file['attributes']['version'], $file['attributes']['public'] ); - $d = dateToTimestamp($file['attributes']['date']); - if($d) - $newfile->setDate($d); - else - $logger->warning("File date (".$file['attributes']['date'].") could not be parsed."); + if($newfile) { + $newfile->setDate(dateToTimestamp($file['attributes']['date'])); + } else { + $logger->error("File ".$file['attributes']['name']." could not be added."); + } unlink($filename); } }