diff --git a/src/Encryptable.php b/src/Encryptable.php index ea78237..343d19e 100644 --- a/src/Encryptable.php +++ b/src/Encryptable.php @@ -40,7 +40,9 @@ public function encryptable($key) */ protected function decryptAttribute($value) { - $value = decrypt($value); + if ($value) { + $value = decrypt($value); + } return $value; } @@ -55,7 +57,9 @@ protected function decryptAttribute($value) */ protected function encryptAttribute($value) { - $value = encrypt($value); + if ($value) { + $value = encrypt($value); + } return $value; }