Skip to content

Commit

Permalink
Fixed error lua/streamradio_core/network.lua:673: attempt to index lo…
Browse files Browse the repository at this point in the history
…cal 'entTable' (a nil value)
  • Loading branch information
Grocel committed Jun 11, 2024
1 parent fcb96c3 commit aec2918
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions lua/streamradio_core/network.lua
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ function LIB.SetupDataTables(entOrOntTable)
entTable = entOrOntTable:GetTable()
end

if not entTable then return end
LIB.SetupEntityTable(ent)

local NW = entTable.StreamRadioDT
Expand Down Expand Up @@ -433,6 +434,8 @@ end

local function pollNwStackKillThis(stackItem)
local entTable = stackItem[1]
if not entTable then return end

local ent = entTable.Entity

if not entTable.IsValid(ent) then return end
Expand All @@ -452,6 +455,7 @@ local function pollNwStackLoopThis(stackItem)
if not ent then return end
if not setter then return end

if not entTable then return end
if not entTable.IsValid(ent) then return end
if entTable.IsMarkedForDeletion(ent) then return end

Expand Down Expand Up @@ -668,7 +672,14 @@ StreamRadioLib.Hook.Add("Tick", "Entity_Network_Tick", function()
LIB.PollNwStack()

for index, ent in pairs(StreamRadioLib.SpawnedRadios) do
if not ent then
continue
end

local entTable = ent:GetTable()
if not entTable then
continue
end

if not entTable.IsValid(ent) then
continue
Expand All @@ -680,6 +691,9 @@ end)

function LIBDebug.DumpDTNetworkStats(ent)
local entTable = ent:GetTable()
if not entTable then
return
end

local NW = entTable.StreamRadioDT or {}
local Count = NW.Count or {}
Expand Down Expand Up @@ -709,6 +723,9 @@ end

function LIBDebug.DumpDTNetworkVars(ent)
local entTable = ent:GetTable()
if not entTable then
return
end

local NW = entTable.StreamRadioDT or {}

Expand Down
4 changes: 2 additions & 2 deletions materials/3dstreamradio/_data/version.vmt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
443
1708179919
444
1718126074

0 comments on commit aec2918

Please sign in to comment.