Skip to content

Commit

Permalink
Added check if dataUri exists (#650)
Browse files Browse the repository at this point in the history
* Update DataUriAdapter.php

Added check if `dataUri` is present

* Apply php-cs-fixer changes

---------

Co-authored-by: Corepex <[email protected]>
  • Loading branch information
Corepex and Corepex authored Jan 7, 2025
1 parent 278b22a commit a8f05ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Asset/Updater/Adapter/DataUriAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Pimcore\Model\Asset;
use Pimcore\Model\Element\ElementInterface;
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
use function array_key_exists;

/**
* @internal
Expand All @@ -32,7 +33,7 @@

public function update(ElementInterface $element, array $data): void
{
if (!$element instanceof Asset) {
if (!$element instanceof Asset || !array_key_exists($this->getIndexKey(), $data)) {
return;
}

Expand Down

0 comments on commit a8f05ac

Please sign in to comment.