Skip to content

Commit

Permalink
Fix error on destruct with nil streams
Browse files Browse the repository at this point in the history
Fix client to server sending
  • Loading branch information
Denneisk committed Feb 9, 2024
1 parent 5cc3ad0 commit 85cf3ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_expression2/core/files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ registerCallback("destruct", function(self)

local iterable = { uploads[player], lists[player] } -- Ignore downloads in case the user is backing up data on removed

if iterable[1][1] and iterable[1][1].ent == entity then
if iterable[1][1] and iterable[1][1].ent == entity and iterable[1][1].Stream then
iterable[1][1].Stream:Remove() -- Special case for uploading files and only uploading files
end
for _, tab in ipairs(iterable) do
Expand Down Expand Up @@ -411,7 +411,7 @@ net.Receive("wire_expression2_file_upload", function(_, ply)
file_execute(ply, pfile, FILE_TRANSFER_ERROR)
else
pfile.uploading = true
pfile.Stream = net.ReadStream(nil, function(data)
pfile.Stream = net.ReadStream(ply, function(data)
pfile.data = data
pfile.uploading = false
pfile.uploaded = true
Expand Down

0 comments on commit 85cf3ee

Please sign in to comment.