Skip to content

Commit 156e788

Browse files
authored
Merge pull request #18 from safly/patch-1
fix null field
2 parents 34d9bbe + 0b91067 commit 156e788

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Traits/EncryptableDbAttribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function getAttributeValue($key)
3030
}
3131

3232
// decrypt value before casts
33-
if (in_array($key, $this->encryptable)) {
33+
if (in_array($key, $this->encryptable) && !is_null($value) && $value !== '') {
3434
$value = $this->decrypt($value);
3535
}
3636

0 commit comments

Comments
 (0)