Fix error if xgui getbans is called without a filter parameter

May reduce errors in cases of a conflicting addon
This commit is contained in:
SticklyMan 2024-07-19 17:56:23 -06:00
parent 6c88e39836
commit 07aafe3748
3 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,7 @@
# ULX Changelog # ULX Changelog
## Upcoming - *(00/00/00)* ## Upcoming - *(00/00/00)*
* [FIX] XGUI: Server error if internal bandata endpoint is called with missing parameters.
## v3.81 - *(03/24/24)* ## v3.81 - *(03/24/24)*
* [ADD] Added chat commands to both banid and unban. (Thanks, TheByKotik) * [ADD] Added chat commands to both banid and unban. (Thanks, TheByKotik)

View File

@ -105,7 +105,7 @@ function bans.init()
xgui.bansbyunban = {} xgui.bansbyunban = {}
xgui.bansbybanlength = {} xgui.bansbybanlength = {}
end end
local sortTypeTable = { local sortTypeTable = {
[1] = function() [1] = function()
-- Bans by Name -- Bans by Name
@ -149,7 +149,7 @@ function bans.init()
table.sort( xgui.bansbyreason, function( a, b ) return a[2] < b[2] end ) table.sort( xgui.bansbyreason, function( a, b ) return a[2] < b[2] end )
end end
return xgui.bansbyreason return xgui.bansbyreason
end, end,
[5] = function() [5] = function()
-- Bans by Unban Date -- Bans by Unban Date
@ -199,7 +199,7 @@ function bans.init()
-- Default params -- Default params
sortType = tonumber( args[1] ) or 0 sortType = tonumber( args[1] ) or 0
filterString = args[2] ~= "" and string.lower( args[2] ) or nil filterString = (args[2] ~= "" and args[2] ~= nil) and string.lower( args[2] ) or nil
filterPermaBan = args[3] and tonumber( args[3] ) or 0 filterPermaBan = args[3] and tonumber( args[3] ) or 0
filterIncomplete = args[4] and tonumber( args[4] ) or 0 filterIncomplete = args[4] and tonumber( args[4] ) or 0
page = tonumber( args[5] ) or 1 page = tonumber( args[5] ) or 1

View File

@ -1 +1 @@
1711264842 1721433383