mirror of
https://github.com/chev2/gmod-addons.git
synced 2025-10-30 06:31:35 +00:00
SprayMesh Extended: Fix spray customizer empty spray list edge case
This commit is contained in:
parent
43f85068f7
commit
df6717b0f1
2 changed files with 8 additions and 5 deletions
|
|
@ -45,5 +45,5 @@ end
|
|||
function spraylist.GetSprays()
|
||||
local queryResults = sql.Query("SELECT url, name FROM spraymesh_extended_spray_list ORDER BY name DESC")
|
||||
|
||||
return queryResults
|
||||
return queryResults or {}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -154,11 +154,14 @@ function PANEL:Init()
|
|||
self.IconLayout:SetSpaceY(sprayLayoutSpace)
|
||||
|
||||
-- Load saved sprays
|
||||
for _, savedSprayData in ipairs(spraylist.GetSprays()) do
|
||||
local url = savedSprayData.url
|
||||
local name = savedSprayData.name
|
||||
local savedSprays = spraylist.GetSprays()
|
||||
if savedSprays and #savedSprays > 0 then
|
||||
for _, savedSprayData in ipairs(savedSprays) do
|
||||
local url = savedSprayData.url
|
||||
local name = savedSprayData.name
|
||||
|
||||
self:AddSpray(url, name)
|
||||
self:AddSpray(url, name)
|
||||
end
|
||||
end
|
||||
|
||||
--
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue