Skip to content

Commit ec7d10e

Browse files
authored
Merge pull request #137 from firegento/sprankhub-patch-2
Fix potential type error
2 parents f72c91f + 6e04faf commit ec7d10e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Model/Import/Category.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,8 @@ private function saveCategories(): self
10351035
if (isset($attrParams['options'][strtolower($attrValue)])) {
10361036
$attrValue = $attrParams['options'][strtolower($attrValue)];
10371037
}
1038-
} elseif ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {
1038+
} elseif ('datetime' == $attribute->getBackendType() && is_string($attrValue)
1039+
&& strtotime($attrValue)) {
10391040
$attrValue = (new \DateTime($attrValue))->format(DateTime::DATETIME_PHP_FORMAT);
10401041
} elseif ($backModel && 'available_sort_by' != $attrCode) {
10411042
$attribute->getBackend()->beforeSave($category);

0 commit comments

Comments
 (0)