From 1b52f3ca3e830876036ebf30d67adabbbbd596ea Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 7 Feb 2025 13:55:28 +0200 Subject: [PATCH] ref --- .../Core/Upgrades/Actions/Extension/Install.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/application/Espo/Core/Upgrades/Actions/Extension/Install.php b/application/Espo/Core/Upgrades/Actions/Extension/Install.php index b8841642da..577fa15340 100644 --- a/application/Espo/Core/Upgrades/Actions/Extension/Install.php +++ b/application/Espo/Core/Upgrades/Actions/Extension/Install.php @@ -183,11 +183,14 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install $manifest = $this->getManifest(); $extensionEntity = $this->getExtensionEntity(); - if (isset($extensionEntity)) { - $comparedVersion = version_compare($manifest['version'], $extensionEntity->get('version'), '>='); - if ($comparedVersion <= 0) { - $this->throwErrorAndRemovePackage('You cannot install an older version of this extension.'); - } + if (!$extensionEntity) { + return; + } + + $comparedVersion = version_compare($manifest['version'], $extensionEntity->getVersion(), '>='); + + if ($comparedVersion <= 0) { + $this->throwErrorAndRemovePackage('You cannot install an older version of this extension.'); } }