Skip to content

Commit be05c58

Browse files
committed
Fix bug: Couldn't retrive a remote preview image file.
1 parent fda77d0 commit be05c58

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/ProductVideo/Controller/Adminhtml/Product/Gallery/RetrieveImage.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ protected function retrieveRemoteImage($fileUrl, $localFilePath)
131131
$this->curl->setConfig(['header' => false]);
132132
$this->curl->write('GET', $fileUrl);
133133
$image = $this->curl->read();
134+
if (empty($image)) {
135+
throw new \InvalidArgumentException("Couldn't retrive a remote preview image file. Service is inaccessible.");
136+
}
134137
$this->fileUtility->saveFile($localFilePath, $image);
135138
}
136139

0 commit comments

Comments
 (0)