Added check for nil player for role get_players

This commit is contained in:
Cooldude2606
2020-08-14 16:18:02 +01:00
parent ad457343a4
commit 7939d8d3f7

View File

@@ -946,7 +946,7 @@ function Roles._prototype:get_players(online)
if role_name == self.name then
local player = game.players[player_name]
-- Filter by online state if required
if online == nil or player.connected == online then
if player and (online == nil or player.connected == online) then
players[#players+1] = player
end
break