Avoid a crash when ReturnGroup is null

Always checking if ReturnGroup is not null before testing
ReturnGroup::isExist()
This commit is contained in:
svenvandevelde 2015-10-25 10:48:46 +01:00
parent 4d9bcbe6b7
commit 3b05e2d30d

View File

@ -68,9 +68,9 @@ end
-- @treturn Group
function CLIENT:ClientGroup()
--trace.f(self.ClassName)
local GroupExists = Group.getByName( self.ClientName )
if GroupExists::isExist() then
return GroupExists
local ReturnGroup = Group.getByName( self.ClientName )
if ReturnGroup and ReturnGroup::isExist() then
return ReturnGroup
else
return nil
end