Default Lua files creating script errors

Hi, I run a relatively large TTT server, and have been getting this Lua script error lately. I am not sure what is causing it as it is not custom code.


[ERROR] lua/includes/modules/net.lua:92: table index is nil
  1. ReadType - lua/includes/modules/net.lua:92
   2. ReadType - lua/includes/modules/net.lua:90
    3. ReadTable - lua/includes/modules/net.lua:90
     4. oldFunc - addons/damagelog/lua/cl_tabs/old_logs.lua:238
      5. func - addons/dbugr/lua/dbugr/util/modules/sh_func.lua:80
       6. unknown - lua/includes/modules/net.lua:31

Thanks in advance for any responses here - Josh

The reason it is giving you that error is because of these two files:



     4. oldFunc - addons/damagelog/lua/cl_tabs/old_logs.lua:238
      5. func - addons/dbugr/lua/dbugr/util/modules/sh_func.lua:80

Which use that lua function, making it output nil.

Look in those two files at the designated lines.

For the line 4 function, I have this


net.Receive("DL_SendLogsList", function()
	Damagelog.CurLogsTable = net.ReadTable()
	if ValidPanel(Damagelog.OldLogs) then
		Damagelog.OldLogs:UpdateDates()
	end
end)


I noticed this occured when there was a lot of old logs, deleting them fixed it.

Not really best way of solving it but at the time I couldn’t be bothered looking through code and find what was causing it to happen after so many logs were saved.

Thank you for that advice Scottehh, you were referring to ulx logs correct?

The reason this happens is because your table is corrupted upon being received. Either it’s a broken table or it is never sent in the first place.

That’s usually the cause of a net.ReadType() issue when using net.ReadTable().

The reason deleting the logs would fix anything is because they are probably under an incorrect format of storage or whatnot.