diff --git a/backend/modules/file/logic/file/FileManager.php b/backend/modules/file/logic/file/FileManager.php index 5c3e534..ecc934c 100755 --- a/backend/modules/file/logic/file/FileManager.php +++ b/backend/modules/file/logic/file/FileManager.php @@ -146,11 +146,9 @@ class FileManager $fileNewIdStr = $dataModel->$fileIdStrName; $dataModel->save(); $saveFileRes = GoodsManager::saveFile(explode(',', $fileNewIdStr), $dataModel, explode(',', $fileOldIdStr), $fileType); - if ($fileNameInModel) { - if ($saveFileRes['status']) { - $dataModel->$fileNameInModel = $saveFileRes['first_file_id']; - $dataModel->save(); - } + if ($fileNameInModel && $saveFileRes['status'] && $saveFileRes['first_file_id']) { + $dataModel->$fileNameInModel = $saveFileRes['first_file_id']; + $dataModel->save(); } return true; }