Skip to content

Commit 04cfa4b

Browse files
committed
MDVA-222: Port down MAGETWO-50611
1 parent d583bd8 commit 04cfa4b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

app/code/Magento/WebapiSecurity/Model/Plugin/CacheInvalidator.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,20 @@ public function __construct(\Magento\Framework\App\Cache\TypeListInterface $cach
2626
* Invalidate WebApi cache if needed.
2727
*
2828
* @param \Magento\Framework\App\Config\Value $subject
29-
* @param \Magento\Framework\App\Config\Value $result
30-
* @return \Magento\Framework\App\Config\Value
29+
* @param \Magento\Framework\App\Config\Value|null $result
30+
* @return \Magento\Framework\App\Config\Value|null
3131
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3232
*/
3333
public function afterAfterSave(
3434
\Magento\Framework\App\Config\Value $subject,
35-
\Magento\Framework\App\Config\Value $result
35+
$result
3636
) {
37-
if ($result->getPath() == \Magento\WebapiSecurity\Model\Plugin\AnonymousResourceSecurity::XML_ALLOW_INSECURE
38-
&& $result->isValueChanged()
39-
) {
40-
$this->cacheTypeList->invalidate(\Magento\Framework\App\Cache\Type\Webapi::TYPE_IDENTIFIER);
37+
if (!is_null($result)) {
38+
if ($result->getPath() == \Magento\WebapiSecurity\Model\Plugin\AnonymousResourceSecurity::XML_ALLOW_INSECURE
39+
&& $result->isValueChanged()
40+
) {
41+
$this->cacheTypeList->invalidate(\Magento\Framework\App\Cache\Type\Webapi::TYPE_IDENTIFIER);
42+
}
4143
}
4244

4345
return $result;

0 commit comments

Comments
 (0)