diff --git a/app/Http/Requests/Client/StoreClientRequest.php b/app/Http/Requests/Client/StoreClientRequest.php index 0fb8412dc..417f96550 100644 --- a/app/Http/Requests/Client/StoreClientRequest.php +++ b/app/Http/Requests/Client/StoreClientRequest.php @@ -81,7 +81,7 @@ class StoreClientRequest extends Request $input['group_settings_id'] = $this->decodePrimaryKey($input['group_settings_id']); } - if(empty($input['settings']->currency_id)) + if(empty($input['settings']) || empty($input['settings']->currency_id)) { if(empty($input['group_settings_id'])) { diff --git a/app/Models/User.php b/app/Models/User.php index ea50234ec..94c43c2fc 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -183,7 +183,7 @@ class User extends Authenticatable implements MustVerifyEmail public function company_user() { - if (!$this->id) { + if (!$this->id && auth()->user()) { $this->id = auth()->user()->id; }