Skip to content

Commit

Permalink
Throw exception when container is null before use it (#611)
Browse files Browse the repository at this point in the history
* Throw exception when container is null before use it
  • Loading branch information
sowbiba authored Aug 10, 2023
1 parent 918a0c9 commit 53e2556
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>ps_mbo</name>
<displayName><![CDATA[PrestaShop Marketplace in your Back Office]]></displayName>
<version><![CDATA[2.3.1]]></version>
<version><![CDATA[2.3.2]]></version>
<description><![CDATA[Discover the best PrestaShop modules to optimize your online store.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[administration]]></tab>
Expand Down
6 changes: 5 additions & 1 deletion ps_mbo.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class ps_mbo extends Module
public function __construct()
{
$this->name = 'ps_mbo';
$this->version = '2.3.1';
$this->version = '2.3.2';
$this->author = 'PrestaShop';
$this->tab = 'administration';
$this->module_key = '6cad5414354fbef755c7df4ef1ab74eb';
Expand Down Expand Up @@ -831,6 +831,10 @@ public function get($serviceName)
$this->container = SymfonyContainer::getInstance();
}

if (null === $this->container) {
throw new Exception('Cannot get a valid Sf Container');
}

return $this->container->get($serviceName);
}

Expand Down

0 comments on commit 53e2556

Please sign in to comment.