Skip to content

Commit

Permalink
QUICK FIX: ADDED A CHECK BEFORE RENDERING THE TWIG
Browse files Browse the repository at this point in the history
  • Loading branch information
SteponasK committed Mar 20, 2024
1 parent 82b53d9 commit 4fcb4e4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions academyerpintegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ private function autoLoad(): void
public function hookDisplayAdminOrderMain(array $params)
{
$order = new Order($params['id_order']);
$externalModuleName = Carrier::getCarrierByReference($order->getIdOrderCarrier())->external_module_name;

$carrier = Carrier::getCarrierByReference($order->getIdOrderCarrier());
if(!($carrier instanceof Carrier)){
return '';
}
$externalModuleName = $carrier->external_module_name;

if(is_string($externalModuleName) && $externalModuleName == $this->name){
$twig = $this->getContainer()->get('twig');
$address = new Address($order->id_address_delivery);
Expand Down

0 comments on commit 4fcb4e4

Please sign in to comment.