From 4b070da81ff58d64842eca1c2606188855e81e0e Mon Sep 17 00:00:00 2001 From: Nick Schaller Date: Sun, 7 Apr 2024 16:00:20 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Don't=20consider=20null=20types?= =?UTF-8?q?=20for=20decryption?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/VirtualColumn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VirtualColumn.php b/src/VirtualColumn.php index e3cfec6..768a07f 100644 --- a/src/VirtualColumn.php +++ b/src/VirtualColumn.php @@ -45,7 +45,7 @@ trait VirtualColumn foreach ($this->getAttribute(static::getDataColumn()) ?? [] as $key => $value) { $attributeHasEncryptedCastable = in_array(data_get($this->getCasts(), $key), $encryptedCastables); - if ($attributeHasEncryptedCastable && $this->valueEncrypted($value)) { + if ($value && $attributeHasEncryptedCastable && $this->valueEncrypted($value)) { $this->attributes[$key] = $value; } else { $this->setAttribute($key, $value);