diff --git a/src/Eccube/Controller/Admin/Product/CsvImportController.php b/src/Eccube/Controller/Admin/Product/CsvImportController.php index 24c6b387c14..71b271c5ea7 100644 --- a/src/Eccube/Controller/Admin/Product/CsvImportController.php +++ b/src/Eccube/Controller/Admin/Product/CsvImportController.php @@ -1130,10 +1130,12 @@ protected function createProductClass($row, Product $Product, $data, $headerByKe } } - if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) { - $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']])); - } else { - $ProductClass->setCode(null); + if (isset($row[$headerByKey['product_code']])) { + if (StringUtil::isNotBlank($row[$headerByKey['product_code']])) { + $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']])); + } else { + $ProductClass->setCode(null); + } } if (!isset($row[$headerByKey['stock_unlimited']]) @@ -1308,10 +1310,12 @@ protected function updateProductClass($row, Product $Product, ProductClass $Prod } } - if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) { - $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']])); - } else { - $ProductClass->setCode(null); + if (isset($row[$headerByKey['product_code']])) { + if (StringUtil::isNotBlank($row[$headerByKey['product_code']])) { + $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']])); + } else { + $ProductClass->setCode(null); + } } if (!isset($row[$headerByKey['stock_unlimited']])