From 53e2556ebad228a141f0545673c6b3c48ce9c2f4 Mon Sep 17 00:00:00 2001 From: Ibrahima SOW Date: Thu, 10 Aug 2023 15:05:14 +0000 Subject: [PATCH] Throw exception when container is null before use it (#611) * Throw exception when container is null before use it --- config.xml | 2 +- ps_mbo.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config.xml b/config.xml index 47cf399ec..196d2ff21 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ ps_mbo - + diff --git a/ps_mbo.php b/ps_mbo.php index 4160ee58c..868cccedb 100644 --- a/ps_mbo.php +++ b/ps_mbo.php @@ -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'; @@ -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); }