From c5d01f3ad2e1f30cb9a6ab61fda8086e707f0660 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Wed, 5 Dec 2018 15:03:52 -0600 Subject: [PATCH] user model --- app/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/User.php b/app/User.php index b90a8d695..337b6b853 100644 --- a/app/User.php +++ b/app/User.php @@ -81,7 +81,7 @@ class User extends Authenticatable $found = UserRole::where(['character_id' => $this->character_id, 'role' => $role])->get(); - if($found[0]->role == $role) { + if(isset($found[0]) && $found[0]->role == $role) { return true; } else { return false; @@ -92,7 +92,7 @@ class User extends Authenticatable //Search for the super user role for the character from the database $found = UserRole::where(['character_id' => $this->character_id, 'role' => 'SuperUser'])->get(['role']); //If we find the SuperUser role, then the user has it, and returns true, else returns false - if($found[0]->role == 'SuperUser') { + if(isset($found[0]->role) && $found[0]->role == 'SuperUser') { return true; } else { return false;