Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Catch decrypt exceptions.
James Colecbe3fb73a88a
diff --git a/app/Models/Preference.php b/app/Models/Preference.phpindex 44e5951cbf..cbb7b0512a 100644--- a/app/Models/Preference.php+++ b/app/Models/Preference.php@@ -12,6 +12,8 @@ declare(strict_types = 1);namespace FireflyIII\Models;use Crypt;+use FireflyIII\Exceptions\FireflyException;+use Illuminate\Contracts\Encryption\DecryptException;use Illuminate\Database\Eloquent\Model;/**@@ -48,7 +50,11 @@ class Preference extends Model*/public function getDataAttribute($value){- $data = Crypt::decrypt($value);+ try {+ $data = Crypt::decrypt($value);+ } catch (DecryptException $e) {+ throw new FireflyException('Could not decrypt preference #' . $this->id . '.');+ }return json_decode($data);}