From 3bbf84896c2d3655b67c70761ad16c633c156b41 Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Sat, 27 Oct 2018 14:01:49 -0500 Subject: [PATCH] Permission bug fix If a player does not have a rank this function will crash the game. --- factions.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/factions.lua b/factions.lua index e7dc531..97ed9f8 100644 --- a/factions.lua +++ b/factions.lua @@ -409,11 +409,13 @@ function factions.Faction.has_permission(self, player, permission) return false end local perms = self.ranks[p] - for i in ipairs(perms) do - if perms[i] == permission then - return true - end - end + if perms then + for i in ipairs(perms) do + if perms[i] == permission then + return true + end + end + end return false end