wiremod / wire

Garry's Mod add-on that allows users to wire up components in order to make more elaborate automatic and user-controlled contraptions.
http://www.wiremod.com
Apache License 2.0
549 stars 333 forks source link

lua/entities/gmod_wire_expression2/core/cl_files.lua:70: attempt to index a nil value #3116

Closed Zvbhrf closed 1 month ago

Zvbhrf commented 1 month ago

I experienced this issue on server I'm currently maintaining. After a 40+ minutes of fixing a problem I saw that we had an old version of file.lua. The structure of wire_expression2_file_download net message was different, and because of that net.ReadString() returned garbage on client and there was no stream message.

So, I decided to add a notify message about an old version, just to safe devs' time, who decided to update to the latest versions of Wiremod, but have old files and also to be safe from random net messages.

Error

[Wiremod] lua/entities/gmod_wire_expression2/core/cl_files.lua:70: attempt to index a nil value
  1. func - lua/entities/gmod_wire_expression2/core/cl_files.lua:70
   2. unknown - lua/includes/extensions/net.lua:38

What returned net.ReadStream

nil

Expression2 test code

print(fileWrite("a.txt", "123"))

Also provide info for people who don't understand Lua: image