Skip to content

Commit

Permalink
#94738 fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwaclawczyk committed Jul 8, 2024
1 parent d30d2ac commit c89c331
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Model/Menu/Node/Image/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ public function getImageSize(string $file): array
$mediaDirectory = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA);
$fileFullPath = $mediaDirectory->getAbsolutePath(self::PATH . $file);

return getimagesize($fileFullPath);
try {
return getimagesize($fileFullPath);
} catch (Exception $e) {
return [];
}
}

private function getAbsolutePath(): string
Expand Down
2 changes: 1 addition & 1 deletion Model/ResourceModel/Menu/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function _afterSave(\Magento\Framework\Model\AbstractModel $object)
$nodeCustomerGroups = json_decode($nodeCustomerGroups);
}
$insertData = [];
foreach ($nodeCustomerGroups as $customerGroup) {
foreach ($nodeCustomerGroups ?? [] as $customerGroup) {
$insertData[] = [
'node_id' => $object->getNodeId(),
'group_id' => $customerGroup
Expand Down
2 changes: 1 addition & 1 deletion Model/ResourceModel/Menu/Node/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public function __construct(
AdapterInterface $connection = null,
AbstractDb $resource = null
) {
parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);
$this->scopeConfig = $scopeConfig;
parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);
}

protected function _construct()
Expand Down

0 comments on commit c89c331

Please sign in to comment.