Skip to content

Commit ebe9565

Browse files
Merge branch '4.4' into 5.4
* 4.4: [HttpKernel] lock when writting profiles Using identical comparison for path validation [Mime] Fix email rendering when having inlined parts that are not related to the content [HttpFoundation] move flushing outside of Response::closeOutputBuffers [FrameworkBundle] Do not throw when describing a factory definition Fix checking result of DateTime::getLastErrors
2 parents d8c5cc9 + e3f321b commit ebe9565

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Extension/Core/DataTransformer/DateTimeToStringTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function reverseTransform($value)
121121
$outputTz = new \DateTimeZone($this->outputTimezone);
122122
$dateTime = \DateTime::createFromFormat($this->parseFormat, $value, $outputTz);
123123

124-
$lastErrors = \DateTime::getLastErrors();
124+
$lastErrors = \DateTime::getLastErrors() ?: ['error_count' => 0, 'warning_count' => 0];
125125

126126
if (0 < $lastErrors['warning_count'] || 0 < $lastErrors['error_count']) {
127127
throw new TransformationFailedException(implode(', ', array_merge(array_values($lastErrors['warnings']), array_values($lastErrors['errors']))));

0 commit comments

Comments
 (0)