1
0
Fork 0
mirror of https://github.com/archtechx/virtualcolumn.git synced 2025-12-12 12:54:04 +00:00

🐛 Don't consider null types for decryption

This commit is contained in:
Nick Schaller 2024-04-07 16:00:20 +02:00
parent 9594cd0857
commit 4b070da81f

View file

@ -45,7 +45,7 @@ trait VirtualColumn
foreach ($this->getAttribute(static::getDataColumn()) ?? [] as $key => $value) { foreach ($this->getAttribute(static::getDataColumn()) ?? [] as $key => $value) {
$attributeHasEncryptedCastable = in_array(data_get($this->getCasts(), $key), $encryptedCastables); $attributeHasEncryptedCastable = in_array(data_get($this->getCasts(), $key), $encryptedCastables);
if ($attributeHasEncryptedCastable && $this->valueEncrypted($value)) { if ($value && $attributeHasEncryptedCastable && $this->valueEncrypted($value)) {
$this->attributes[$key] = $value; $this->attributes[$key] = $value;
} else { } else {
$this->setAttribute($key, $value); $this->setAttribute($key, $value);