diff --git a/src/Defender/Traits/HasUserRolesTrait.php b/src/Defender/Traits/HasUserRolesTrait.php
index <HASH>..<HASH> 100644
--- a/src/Defender/Traits/HasUserRolesTrait.php
+++ b/src/Defender/Traits/HasUserRolesTrait.php
@@ -29,7 +29,7 @@ trait HasUserRolesTrait {
 	{
 		$roles = $this->roles->lists('name');
 
-		return in_array($role, $roles);
+		return in_array($role, $roles->toArray());
 	}
 
 	/**
@@ -85,4 +85,4 @@ trait HasUserRolesTrait {
 		return $this->roles()->sync($roles);
 	}
 
-}
\ No newline at end of file
+}
Fix error when in_array roles set is empty, its try to access the object, when expects array.