diff --git a/src/Tgstation.Server.Host/IO/PosixPostWriteHandler.cs b/src/Tgstation.Server.Host/IO/PosixPostWriteHandler.cs index d656e0fa99..75eaa24bcd 100644 --- a/src/Tgstation.Server.Host/IO/PosixPostWriteHandler.cs +++ b/src/Tgstation.Server.Host/IO/PosixPostWriteHandler.cs @@ -1,5 +1,6 @@ using Mono.Unix; using Mono.Unix.Native; +using System; namespace Tgstation.Server.Host.IO { @@ -11,6 +12,9 @@ namespace Tgstation.Server.Host.IO /// public void HandleWrite(string filePath) { + if (filePath == null) + throw new ArgumentNullException(nameof(filePath)); + //set executable bit every time, don't want people calling me when their uploaded "sl" binary doesn't work if (Syscall.stat(filePath, out var stat) != 0) throw new UnixIOException(Stdlib.GetLastError()); diff --git a/src/Tgstation.Server.Host/IO/WindowsPostWriteHandler.cs b/src/Tgstation.Server.Host/IO/WindowsPostWriteHandler.cs index 6d149644fa..86907933fe 100644 --- a/src/Tgstation.Server.Host/IO/WindowsPostWriteHandler.cs +++ b/src/Tgstation.Server.Host/IO/WindowsPostWriteHandler.cs @@ -1,4 +1,6 @@ -namespace Tgstation.Server.Host.IO +using System; + +namespace Tgstation.Server.Host.IO { /// /// for Windows systems @@ -6,6 +8,10 @@ sealed class WindowsPostWriteHandler : IPostWriteHandler { /// - public void HandleWrite(string filePath) { } + public void HandleWrite(string filePath) + { + if (filePath == null) + throw new ArgumentNullException(nameof(filePath)); + } } }