From bf77bc261ff1d7d653447f54f872e80eb78085c7 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Fri, 2 Nov 2018 15:14:08 -0400 Subject: [PATCH] Add missing Argument null exceptions to post write handlers --- src/Tgstation.Server.Host/IO/PosixPostWriteHandler.cs | 4 ++++ .../IO/WindowsPostWriteHandler.cs | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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)); + } } }