From 4b42ae32e7901c91e77f739014f608fe53092cdc Mon Sep 17 00:00:00 2001 From: Michiel Gerritsen Date: Mon, 26 Feb 2024 20:56:36 +0100 Subject: [PATCH] Bugfix: Check that the api key is available #752 --- Model/Adminhtml/Backend/ChangeApiMode.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Model/Adminhtml/Backend/ChangeApiMode.php b/Model/Adminhtml/Backend/ChangeApiMode.php index 7e632bf6229..82fc07e740f 100644 --- a/Model/Adminhtml/Backend/ChangeApiMode.php +++ b/Model/Adminhtml/Backend/ChangeApiMode.php @@ -69,7 +69,9 @@ public function beforeSave(): self public function afterSave() { $apiKey = $this->getApiKey($this->getValue()); - $this->updateProfileId->execute($apiKey, $this->getScope(), $this->getScopeId()); + if ($apiKey) { + $this->updateProfileId->execute($apiKey, $this->getScope(), $this->getScopeId()); + } return parent::afterSave(); }