Skip to content

Commit cbbfc18

Browse files
author
mduuude
committed
Merge branch 'MAGETWO-92165' of github.com:magento-qwerty/magento2ce into MAGETWO-92165
2 parents dcb04a1 + 32c9af8 commit cbbfc18

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/code/Magento/Catalog/Model/Product/Option/Type/File/ExistingValidate.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ class ExistingValidate extends \Zend_Validate
1616
*
1717
* @param string $value File's full path.
1818
* @param string|null $originalName Original file's name (when uploaded).
19-
*
20-
* @throws \InvalidArgumentException
2119
*/
2220
public function isValid($value, string $originalName = null)
2321
{
22+
$this->_messages = [];
23+
$this->_errors = [];
24+
2425
if (!is_string($value)) {
25-
throw new \InvalidArgumentException('File\'s full path is expected');
26+
$this->_messages[] = __('Full file path is expected.')->render();
27+
return false;
2628
}
2729

28-
$this->_messages = [];
29-
$this->_errors = [];
3030
$result = true;
3131
$fileInfo = null;
3232
if ($originalName) {

0 commit comments

Comments
 (0)