From 85cf3ee36616d54e9197bdd1f96308c861ee523b Mon Sep 17 00:00:00 2001 From: Denneisk <20892685+Denneisk@users.noreply.github.com> Date: Fri, 9 Feb 2024 18:55:44 -0500 Subject: [PATCH] Fix error on destruct with nil streams Fix client to server sending --- lua/entities/gmod_wire_expression2/core/files.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/entities/gmod_wire_expression2/core/files.lua b/lua/entities/gmod_wire_expression2/core/files.lua index 82a24b36e4..03abcdd883 100644 --- a/lua/entities/gmod_wire_expression2/core/files.lua +++ b/lua/entities/gmod_wire_expression2/core/files.lua @@ -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 @@ -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