From b12209afddf1a22886f79c19f743b4fad0436b73 Mon Sep 17 00:00:00 2001 From: Cody Mercer Date: Mon, 18 Jul 2016 12:36:47 -0500 Subject: [PATCH] fix logic bug --- src/HasSettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HasSettings.php b/src/HasSettings.php index 038abce..6f3a92b 100644 --- a/src/HasSettings.php +++ b/src/HasSettings.php @@ -18,7 +18,7 @@ public static function bootHasSettings() }); self::saving(function ($model) { - if (property_exists($model, 'allowedSettings') && is_array($model->allowedSettings)) { + if ($model->settings && property_exists($model, 'allowedSettings') && is_array($model->allowedSettings)) { $model->settings = array_only($model->settings, $model->allowedSettings); } });